Skip to content

Commit b06f8aa

Browse files
committed
add dump & load API usage to README
1 parent 578ebc3 commit b06f8aa

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ null
4646

4747
# API
4848

49+
## AsyncStorage APIs
4950
AsyncStorageREPL provides RNAsyncStorage on your node REPL as a global object.
5051
You 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

0 commit comments

Comments
 (0)