SWR Internal State #1015
Unanswered
abdelhamid-attaby
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello there,
We made a package with the intention to be used to manage the internal states of projects that rely heavily on external services and have simple internal states. So -for small/simple states- it can be a convenient replacement for
Redux
,PullState
, and even React'sContext
API.The package provides 2 hooks that can be used to manage react (or Next.js) project's internal state in ways: in-memory state, and local storage persistent state.
The package is based on swr as they have built a very good caching method that can be generalized and used with different use cases other than fetching and caching data from an external service. Like managing internal app state and syncing that state between different components.
The 2 hooks that we expose are:
useGlobalState
: used for managing and syncing in-memory state.useLocalStorage
: used for managing and syncing local storage persistent state.NPM Link: https://www.npmjs.com/package/@zyda/swr-internal-state
I would like your feedback on it and if we have the opportunity to merge it with SWR.
Beta Was this translation helpful? Give feedback.
All reactions