question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Create `useAsyncStorage` hook

See original GitHub issue

What 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:closed
  • Created 5 years ago
  • Reactions:8
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

10reactions
msukmanowskycommented, Oct 4, 2019

@michalchudziak I think this would accomplish what you were originally looking to do https://gist.github.com/msukmanowsky/08a3650223dda8b102d2c9fe94ad5c12

2reactions
krizzucommented, Mar 1, 2019

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found