recoil-custom-persist
Advanced tools
Comparing version 2.6.0 to 2.6.1
{ | ||
"name": "recoil-custom-persist", | ||
"version": "2.6.0", | ||
"version": "2.6.1", | ||
"description": "Package for recoil to persist and rehydrate store", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -22,3 +22,3 @@ # Recoil Persist | ||
const { persistAtom } = recoilPersist() | ||
const { persistAtom } = recoilPersist()() | ||
@@ -73,3 +73,3 @@ const counterState = atom({ | ||
+const { persistAtom } = recoilPersist() | ||
+const { persistAtom } = recoilPersist()() | ||
@@ -113,2 +113,5 @@ const counterState = atom({ | ||
storage: localStorage, // configurate which stroage will be used to store the data | ||
})({ | ||
serialize: (input) => JSON.stringify(input), // Custom serialize function | ||
deserialize: (input) => JSON.parse(input) // Custom deserialize function | ||
}) | ||
@@ -115,0 +118,0 @@ ``` |
16362
206