Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: fixing writing
  • Loading branch information
chriscoderdr committed May 18, 2020
1 parent c79f084 commit 9382f60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/docs/guides/persistence.mdx
Expand Up @@ -4,7 +4,7 @@ sidebar_label: State Persistence
---


Recoils makes it easy to persist your state.
Recoil makes it easy to persist your state.

In order to persist your state you need two simple steps:

Expand All @@ -27,8 +27,8 @@ useTransactionObservation_UNSTABLE(({ atomValues, atomInfo, modifiedAtoms, trans
* *transactionMetaData* Gives you metadata about the current change.


After you ensure that you're saving yout state to your storage, you need to recover it, it's easy using the prop *initializeState* on *RecoilRoot* component.
It's a function that give you set method that allows you to update atoms using their key.
After you ensure that you're saving your state to your storage, you need to recover it, it's easy using the prop *initializeState* on *RecoilRoot* component.
It's a function that provides a set method to update atoms given a key.
You just need to pass the atom key and the value you stored to this method and it will update it to the correct state.
Here is a basic example:

Expand Down

0 comments on commit 9382f60

Please sign in to comment.