Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ your `bsconfig.json`:
#### `ReactNativeAsyncStorage.asyncStorageState`

```reason
{
.
[@bs.meth] "getItem": unit => Js.Promise.t(Js.Null.t(string)),
[@bs.meth] "setItem": string => Js.Promise.t(unit),
[@bs.meth] "mergeItem": string => Js.Promise.t(unit),
[@bs.meth] "removeItem": unit => Js.Promise.t(unit),
}
type asyncStorageState = {
getItem: unit => Js.Promise.t(Js.Null.t(string)),
setItem: string => Js.Promise.t(unit),
mergeItem: string => Js.Promise.t(unit),
removeItem: unit => Js.Promise.t(unit),
};


let ReactNativeAsyncStorage.{getItem, setItem} =
ReactNativeAsyncStorage.useAsyncStorage("useAsyncStorage");
```

### Methods
Expand Down
9 changes: 4 additions & 5 deletions src/ReactNativeAsyncStorage.re
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ external multiRemove: array(string) => Js.Promise.t(unit) = "multiRemove";
external flushGetRequests: unit => unit = "flushGetRequests";

type asyncStorageState = {
.
[@bs.meth] "getItem": unit => Js.Promise.t(Js.Null.t(string)),
[@bs.meth] "setItem": string => Js.Promise.t(unit),
[@bs.meth] "mergeItem": string => Js.Promise.t(unit),
[@bs.meth] "removeItem": unit => Js.Promise.t(unit),
getItem: unit => Js.Promise.t(Js.Null.t(string)),
setItem: string => Js.Promise.t(unit),
mergeItem: string => Js.Promise.t(unit),
removeItem: unit => Js.Promise.t(unit),
};

[@bs.module "@react-native-async-storage/async-storage"]
Expand Down