File tree Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Expand file tree Collapse file tree 2 files changed +14
-12
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,16 @@ your `bsconfig.json`:
48
48
#### ` ReactNativeAsyncStorage.asyncStorageState `
49
49
50
50
``` reason
51
- {
52
- .
53
- [@bs.meth] "getItem": unit => Js.Promise.t(Js.Null.t(string)),
54
- [@bs.meth] "setItem": string => Js.Promise.t(unit),
55
- [@bs.meth] "mergeItem": string => Js.Promise.t(unit),
56
- [@bs.meth] "removeItem": unit => Js.Promise.t(unit),
57
- }
51
+ type asyncStorageState = {
52
+ getItem: unit => Js.Promise.t(Js.Null.t(string)),
53
+ setItem: string => Js.Promise.t(unit),
54
+ mergeItem: string => Js.Promise.t(unit),
55
+ removeItem: unit => Js.Promise.t(unit),
56
+ };
57
+
58
+
59
+ let ReactNativeAsyncStorage.{getItem, setItem} =
60
+ ReactNativeAsyncStorage.useAsyncStorage("useAsyncStorage");
58
61
```
59
62
60
63
### Methods
Original file line number Diff line number Diff line change @@ -37,11 +37,10 @@ external multiRemove: array(string) => Js.Promise.t(unit) = "multiRemove";
37
37
external flushGetRequests : unit => unit = "flushGetRequests" ;
38
38
39
39
type asyncStorageState = {
40
- .
41
- [@bs.meth] "getItem": unit => Js . Promise . t (Js . Null . t (string )),
42
- [@bs.meth] "setItem": string => Js . Promise . t (unit ),
43
- [@bs.meth] "mergeItem": string => Js . Promise . t (unit ),
44
- [@bs.meth] "removeItem": unit => Js . Promise . t (unit ),
40
+ getItem: unit => Js . Promise . t (Js . Null . t (string )),
41
+ setItem: string => Js . Promise . t (unit ),
42
+ mergeItem: string => Js . Promise . t (unit ),
43
+ removeItem: unit => Js . Promise . t (unit ),
45
44
};
46
45
47
46
[@ bs . module "@react-native-async-storage/async-storage" ]
You can’t perform that action at this time.
0 commit comments