Create `useAsyncStorage` hook
See original GitHub issueWhat do you think of creating useAsyncStore
hook, that encapsulates the most popular AsyncStorage methods?
const [getItem, setItem] = useAsyncStorage('@NameOfTheStore')
Where setItem(key, value)
would save the key in @NameOfTheStore:${key}
, and getItem(key)
would read from it.
It’s just a thought 😅
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:8 (5 by maintainers)
Top Results From Across the Web
useAsyncStorage custom hook with useState hook in React ...
I try to create a useAsyncStorage custom hook instead, which do same function as LocalStorage custome hook in react to store the data...
Read more >React Native useAsyncStorage hook implementation
Hook Implementation for react native Link to demo Snack Reference Other similar implementation.
Read more >How To Use React Native AsyncStorage - JScrambler Blog
AsyncStorage is a simple, asynchronous, unencrypted by default module that allows you to persist data offline in React Native apps.
Read more >Async hooks | Node.js v19.3.0 Documentation
triggerAsyncId(); // Create a new AsyncHook instance. All of these callbacks are optional. const asyncHook = async_hooks.createHook({ init, before, after, ...
Read more >useLocalStorage React Hook - useHooks
Since the local storage API isn't available in server-rendering environments, we check that typeof window !== "undefined" to make SSR and SSG work...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@michalchudziak I think this would accomplish what you were originally looking to do https://gist.github.com/msukmanowsky/08a3650223dda8b102d2c9fe94ad5c12
🎉 This issue has been resolved in version 1.1.0 🎉
The release is available on:
Your semantic-release bot 📦🚀