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`:
4848#### ` ReactNativeAsyncStorage.asyncStorageState `
4949
5050``` 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");
5861```
5962
6063### Methods
Original file line number Diff line number Diff line change @@ -37,11 +37,10 @@ external multiRemove: array(string) => Js.Promise.t(unit) = "multiRemove";
3737external flushGetRequests : unit => unit = "flushGetRequests" ;
3838
3939type 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 ),
4544};
4645
4746[@ bs . module "@react-native-async-storage/async-storage" ]
You can’t perform that action at this time.
0 commit comments