From 8fb92fc4ef03300f575e6e7d759df0c64ea06a7a Mon Sep 17 00:00:00 2001 From: James Middleton Date: Fri, 11 Oct 2024 15:02:30 +0100 Subject: [PATCH] docs: improve AsyncStorage notes wording --- docs/utilities/storage.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/utilities/storage.mdx b/docs/utilities/storage.mdx index e274b4f287..b35054e31e 100644 --- a/docs/utilities/storage.mdx +++ b/docs/utilities/storage.mdx @@ -142,7 +142,8 @@ const storedAtom = atomWithStorage('stored-key', content, storage) #### Notes with AsyncStorage (since v2.2.0) -If you use any kinds of AsyncStorage, the atom value can become async. Hence, if you are to update the value, you need to possibly resolve the promise. +With AsyncStorage (as with any asynchronous storage), the atom value becomes async. +When updating the atom by referencing the current value, then you'll need to `await` it. ```js const countAtom = atomWithStorage('count-key', 0, anyAsyncStorage)