Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ReScript bindings for @react-native-async-storage/async-storage

License

NotificationsYou must be signed in to change notification settings

rescript-react-native/async-storage

Build StatusVersionReScript Forum

ReScript bindings for@react-native-async-storage/async-storage.

Exposed asReactNativeAsyncStorage module.

@rescript-react-native/async-storage X.y.* means it's compatible with@react-native-async-storage/async-storage X.y.*

Installation

When@react-native-async-storage/async-storageis properly installed & configured by following their installation instructions,you can install the bindings:

npm install @rescript-react-native/async-storage#oryarn add @rescript-react-native/async-storage

@rescript-react-native/async-storage should be added tobs-dependencies inyourbsconfig.json:

{  //...  "bs-dependencies": [    "@rescript/react",    "rescript-react-native",    // ...+    "@rescript-react-native/async-storage"  ],  //...}

Usage

Types

ReactNativeAsyncStorage.asyncStorageState

typeasyncStorageState= {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),};letReactNativeAsyncStorage.{getItem,setItem}=ReactNativeAsyncStorage.useAsyncStorage("useAsyncStorage");

Methods

ReactNativeAsyncStorage.getItem

string=>Js.Promise.t(Js.Null.t(string))

ReactNativeAsyncStorage.setItem

(string,string)=>Js.Promise.t(unit)

ReactNativeAsyncStorage.removeItem

string=>Js.Promise.t(unit)

ReactNativeAsyncStorage.mergeItem

(string,string)=>Js.Promise.t(unit)

ReactNativeAsyncStorage.clear

unit=>Js.Promise.t(unit)

ReactNativeAsyncStorage.getAllKeys

unit=>Js.Promise.t(Js.Null.t(array(string)))

ReactNativeAsyncStorage.multiGet

array(string)=>Js.Promise.t(array((string,Js.Null.t(string))))

ReactNativeAsyncStorage.multiSet

array((string,string))=>Js.Promise.t(unit)

ReactNativeAsyncStorage.multiMerge

array((string,string))=>Js.Promise.t(unit)

ReactNativeAsyncStorage.multiRemove

array(string)=>Js.Promise.t(unit)

ReactNativeAsyncStorage.flushGetRequests

unit=>unit

ReactNativeAsyncStorage.useAsyncStorage

string=>asyncStorageState

Changelog

Check thechangelog for more informations about recentreleases.


Contribute

Read thecontribution guidelinesbefore contributing.

Code of Conduct

We want this community to be friendly and respectful to each other. Please readour full code of conductso that you can understand what actions will and will not be tolerated.

About

ReScript bindings for @react-native-async-storage/async-storage

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp