{"id":18782872,"url":"https://github.com/rescript-react-native/async-storage","last_synced_at":"2025-06-14T23:36:46.868Z","repository":{"id":42003306,"uuid":"205380920","full_name":"rescript-react-native/async-storage","owner":"rescript-react-native","description":"ReScript bindings for @react-native-async-storage/async-storage","archived":false,"fork":false,"pushed_at":"2023-02-09T03:17:59.000Z","size":1023,"stargazers_count":12,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-13T12:08:44.054Z","etag":null,"topics":["async-storage","react","react-native","rescript","rescript-react","rescript-react-native"],"latest_commit_sha":null,"homepage":"","language":"ReScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rescript-react-native.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-30T12:47:14.000Z","updated_at":"2024-02-20T00:57:33.000Z","dependencies_parsed_at":"2024-11-07T20:50:42.340Z","dependency_job_id":null,"html_url":"https://github.com/rescript-react-native/async-storage","commit_stats":{"total_commits":34,"total_committers":6,"mean_commits":5.666666666666667,"dds":0.1470588235294118,"last_synced_commit":"db67bfc13f3ab0238175c1ca0482c2d07a9c5ae1"},"previous_names":["reason-react-native/async-storage"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fasync-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fasync-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fasync-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rescript-react-native%2Fasync-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rescript-react-native","download_url":"https://codeload.github.com/rescript-react-native/async-storage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710432,"owners_count":21149190,"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":["async-storage","react","react-native","rescript","rescript-react","rescript-react-native"],"created_at":"2024-11-07T20:37:21.332Z","updated_at":"2025-04-13T12:08:53.671Z","avatar_url":"https://github.com/rescript-react-native.png","language":"ReScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `@rescript-react-native/async-storage`\n\n[![Build Status](https://github.com/rescript-react-native/async-storage/workflows/Build/badge.svg)](https://github.com/rescript-react-native/async-storage/actions)\n[![Version](https://img.shields.io/npm/v/@rescript-react-native/async-storage.svg)](https://www.npmjs.com/@rescript-react-native/async-storage)\n[![ReScript Forum](https://img.shields.io/discourse/posts?color=e6484f\u0026label=ReScript%20Forum\u0026server=https%3A%2F%2Fforum.rescript-lang.org)](https://forum.rescript-lang.org/)\n\n[ReScript](https://rescript-lang.org) bindings for\n[`@react-native-async-storage/async-storage`](https://github.com/react-native-async-storage/async-storage).\n\nExposed as `ReactNativeAsyncStorage` module.\n\n`@rescript-react-native/async-storage` X.y.\\* means it's compatible with\n`@react-native-async-storage/async-storage` X.y.\\*\n\n## Installation\n\nWhen\n[`@react-native-async-storage/async-storage`](https://github.com/react-native-async-storage/async-storage)\nis properly installed \u0026 configured by following their installation instructions,\nyou can install the bindings:\n\n```console\nnpm install @rescript-react-native/async-storage\n# or\nyarn add @rescript-react-native/async-storage\n```\n\n`@rescript-react-native/async-storage` should be added to `bs-dependencies` in\nyour `bsconfig.json`:\n\n```diff\n{\n  //...\n  \"bs-dependencies\": [\n    \"@rescript/react\",\n    \"rescript-react-native\",\n    // ...\n+    \"@rescript-react-native/async-storage\"\n  ],\n  //...\n}\n```\n\n## Usage\n\n### Types\n\n#### `ReactNativeAsyncStorage.asyncStorageState`\n\n```rescript\ntype asyncStorageState = {\n  getItem: unit =\u003e Js.Promise.t(Js.Null.t(string)),\n  setItem: string =\u003e Js.Promise.t(unit),\n  mergeItem: string =\u003e Js.Promise.t(unit),\n  removeItem: unit =\u003e Js.Promise.t(unit),\n};\n\n\n let ReactNativeAsyncStorage.{getItem, setItem} =\n    ReactNativeAsyncStorage.useAsyncStorage(\"useAsyncStorage\");\n```\n\n### Methods\n\n#### `ReactNativeAsyncStorage.getItem`\n\n```rescript\nstring =\u003e Js.Promise.t(Js.Null.t(string))\n```\n\n#### `ReactNativeAsyncStorage.setItem`\n\n```rescript\n(string, string) =\u003e Js.Promise.t(unit)\n```\n\n#### `ReactNativeAsyncStorage.removeItem`\n\n```rescript\nstring =\u003e Js.Promise.t(unit)\n```\n\n#### `ReactNativeAsyncStorage.mergeItem`\n\n```rescript\n(string, string) =\u003e Js.Promise.t(unit)\n```\n\n#### `ReactNativeAsyncStorage.clear`\n\n```rescript\nunit =\u003e Js.Promise.t(unit)\n```\n\n#### `ReactNativeAsyncStorage.getAllKeys`\n\n```rescript\nunit =\u003e Js.Promise.t(Js.Null.t(array(string)))\n```\n\n#### `ReactNativeAsyncStorage.multiGet`\n\n```rescript\narray(string) =\u003e Js.Promise.t(array((string, Js.Null.t(string))))\n```\n\n#### `ReactNativeAsyncStorage.multiSet`\n\n```rescript\narray((string, string)) =\u003e Js.Promise.t(unit)\n```\n\n#### `ReactNativeAsyncStorage.multiMerge`\n\n```rescript\narray((string, string)) =\u003e Js.Promise.t(unit)\n```\n\n#### `ReactNativeAsyncStorage.multiRemove`\n\n```rescript\narray(string) =\u003e Js.Promise.t(unit)\n```\n\n#### `ReactNativeAsyncStorage.flushGetRequests`\n\n```rescript\nunit =\u003e unit\n```\n\n#### `ReactNativeAsyncStorage.useAsyncStorage`\n\n```rescript\nstring =\u003e asyncStorageState\n```\n\n---\n\n## Changelog\n\nCheck the [changelog](./CHANGELOG.md) for more informations about recent\nreleases.\n\n---\n\n## Contribute\n\nRead the\n[contribution guidelines](https://github.com/rescript-react-native/.github/blob/master/CONTRIBUTING.md)\nbefore contributing.\n\n## Code of Conduct\n\nWe want this community to be friendly and respectful to each other. Please read\n[our full code of conduct](https://github.com/rescript-react-native/.github/blob/master/CODE_OF_CONDUCT.md)\nso that you can understand what actions will and will not be tolerated.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-react-native%2Fasync-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frescript-react-native%2Fasync-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frescript-react-native%2Fasync-storage/lists"}