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

📬 📫 🗄 Declarative AsyncStorage component for React Native

NotificationsYou must be signed in to change notification settings

peterpme/react-native-asyncstorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📬 📫 🗄 Declarative AsyncStorage component for React Native

npm version

Installation

yarn add react-native-asyncstorage

or

npm install --save react-native-asyncstorage

API

AsyncStorage.GetItem

itemKey:stringrender:{loading:boolean,value:string|object,error:string}

AsyncStorage.SetItem

itemKey:stringitemValue:string|objectrender:{loading:boolean,value:string|object,error:string}

Usage Examples

  • Fetchusername fromAsyncStorage before rendering the rest of your app
<AsyncStorage.GetItemitemKey='username'render={({ loading, value, error})=>{if(loading)return<AppLoading/>return(<Viewstyle={styles.container}><Text>Welcome to my app, ${value}</Text></View>)}}/>

Planned Updates

  • multiGet & multiSet support for multiple keys

Shoutout

Thanks to@tkh44 for the idea and his localforage version. He makes a lot of great shit, follow him onTwitter

About

📬 📫 🗄 Declarative AsyncStorage component for React Native

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp