File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change 4646
4747# API
4848
49+ ## AsyncStorage APIs
4950AsyncStorageREPL provides RNAsyncStorage on your node REPL as a global object.
5051You can access [ AsyncStorage's all APIs] ( https://facebook.github.io/react-native/docs/asyncstorage.html ) via this object.
5152
@@ -73,6 +74,26 @@ Actual: number
7374
7475```
7576
77+ ## dump & load
78+
79+ You can save & load RN Application AsyncStorage data.
80+
81+ ` dump() ` provides you getting dump.
82+ ` load(string[][]) ` provides you loading dump.
83+
84+ ``` sh
85+ > const data = RNAsyncStorage.dump ()
86+ undefined
87+ > data
88+ [ [ ' comments' , ' ["foo","bar","baz"]' ] ]
89+ > fs.writeSync(' ./dump1.txt' , JSON.stringify(data))
90+ ```
91+
92+ ``` sh
93+ > const data = JSON.parse(fs.readSync(' ./dump1.txt' ))
94+ > RNAsyncStorage.load(data)
95+ null
96+ ```
7697# Advanced Usage
7798
7899## ReactNative side
You can’t perform that action at this time.
0 commit comments