use-cookie-state
use-local-storage-state
use-cookie-state | use-local-storage-state | |
---|---|---|
1 | 8 | |
10 | 1,059 | |
- | - | |
4.7 | 7.9 | |
19 days ago | 15 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
use-cookie-state
-
Store state in cookies with use-cookie-state React hook
πͺ https://github.com/dqunbp/use-cookie-state πͺ
use-local-storage-state
-
My ingenious library failed but my simple one reached 2m downloads
TL;DR; Today I saw my simple library use-local-storage-state has reached 2 million total downloads while my other ingenious* library main-thread-scheduling has only 8k. I explore why because: 1) it's curious, 2) I want to maximize my value in the open-source community by not making the same mistake twice.
-
My open-source principles
No bloat. I am inspired by Sindre Sorhus. I aim to create small and focused modules. I commonly decline feature requests and propose an alternative ad-hoc solution to the user. When the request is valid and can't be implemented outside the library, I usually refactor enough so the bundle size remains almost the same. Take a look at the history of use-local-storage-state through the last versions. The size got smaller! If the feature is too big, I may consider splitting the problems into two repos.
-
Better npm search proposal
For example, I just searched for "local storage react hook npm" and it didn't show my own library use-local-storage-state. For context, my library is the most downloaded and most maintained local storage react hook library on npm.
- Anyone can help me with localStorage stuff for a JavaScript E-commerce project please ? :)
-
One year ago, I created a small library that just hit 10k downloads per week
This looks a lot like one of the issues I have in the library β https://github.com/astoilkov/use-local-storage-state/issues/24.
-
React Hooks Factories
use-local-storage-state - the prime example that inspired me to write this blog post.
What are some alternatives?
jotai - π» Primitive and flexible state management for React
SWR - React Hooks for Data Fetching
pullstate - Simple state stores using immer and React hooks - re-use parts of your state by pulling it anywhere you like!
react-intersection-observer - React implementation of the Intersection Observer API to tell you when an element enters or leaves the viewport.
use-cookie-consent - Smol (~1kB gzipped) hook for managing GDPR cookie consent state.
react-cool-inview - π π₯οΈ React hook to monitor an element enters or leaves the viewport (or another element).
use-color - πΌπΌπΌ The powerful color hook that all designers deserve. β¨ Parse and stringify that just works & π¦Ύ Strict type checking at compile time
use-onclickoutside - React hook for listening for clicks outside of an element.
valtio - π Valtio makes proxy-state simple for React and Vanilla
Material UI - Ready-to-use foundational React components, free forever. It includes Material UI, which implements Google's Material Design.
Recoil - Recoil is an experimental state management library for React apps. It provides several capabilities that are difficult to achieve with React alone, while being compatible with the newest features of React.
storage - A library to use Web Storage API with Observables