{"id":16667257,"url":"https://github.com/peterpme/react-native-asyncstorage","last_synced_at":"2025-03-21T17:32:27.300Z","repository":{"id":57335472,"uuid":"101517474","full_name":"peterpme/react-native-asyncstorage","owner":"peterpme","description":"📬 📫 🗄 Declarative AsyncStorage component for React Native","archived":false,"fork":false,"pushed_at":"2017-08-27T18:24:49.000Z","size":57,"stargazers_count":31,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T11:13:38.297Z","etag":null,"topics":["asyncstorage","declarative","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterpme.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-08-26T22:52:25.000Z","updated_at":"2024-01-14T15:57:56.000Z","dependencies_parsed_at":"2022-09-14T18:50:43.758Z","dependency_job_id":null,"html_url":"https://github.com/peterpme/react-native-asyncstorage","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Freact-native-asyncstorage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Freact-native-asyncstorage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Freact-native-asyncstorage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterpme%2Freact-native-asyncstorage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterpme","download_url":"https://codeload.github.com/peterpme/react-native-asyncstorage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221817278,"owners_count":16885494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asyncstorage","declarative","react-native"],"created_at":"2024-10-12T11:13:38.992Z","updated_at":"2024-10-28T10:31:51.918Z","avatar_url":"https://github.com/peterpme.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-asyncstorage\n\n📬 📫 🗄 Declarative AsyncStorage component for React Native\n\n[![npm version](https://badge.fury.io/js/react-native-asyncstorage.svg)](https://badge.fury.io/js/react-native-asyncstorage)\n\n- [Installation](#installation)\n- [API](#api)\n- [Usage Examples](#usage-examples)\n\n## Installation\n\n```zsh\nyarn add react-native-asyncstorage\n```\n\nor\n\n```zsh\nnpm install --save react-native-asyncstorage\n```\n\n## API\n\n- [AsyncStorage.GetItem](#asyncstoragegetitem)\n- [AsyncStorage.SetItem](#asyncstoragesetitem)\n\n## AsyncStorage.GetItem\n\n```js\nitemKey:  string\nrender: {\n  loading: boolean,\n  value: string | object,\n  error: string\n}\n```\n\n## AsyncStorage.SetItem\n\n```js\nitemKey: string\nitemValue: string | object\nrender: {\n  loading: boolean,\n  value: string | object,\n  error: string\n}\n```\n\n## Usage Examples\n\n- Fetch `username` from `AsyncStorage` before rendering the rest of your app\n\n```jsx\n\u003cAsyncStorage.GetItem\n  itemKey='username'\n  render={({ loading, value, error }) =\u003e {\n\n    if (loading) return \u003cAppLoading /\u003e\n    \n    return (\n      \u003cView style={styles.container}\u003e\n        \u003cText\u003eWelcome to my app, ${value}\u003c/Text\u003e\n      \u003c/View\u003e\n    )\n    \n  }}\n/\u003e\n```\n\n## Planned Updates\n\n- multiGet \u0026 multiSet support for multiple keys\n\n## Shoutout\n\nThanks to [@tkh44 for the idea and his localforage version](https://github.com/tkh44/react-localforage). He makes a lot of great shit, follow him on [Twitter](https://www.twitter.com/tkh44)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterpme%2Freact-native-asyncstorage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterpme%2Freact-native-asyncstorage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterpme%2Freact-native-asyncstorage/lists"}