{"id":22663170,"url":"https://github.com/puti94/react-native-simple-local-storage","last_synced_at":"2025-03-29T09:14:05.780Z","repository":{"id":57340050,"uuid":"254604137","full_name":"puti94/react-native-simple-local-storage","owner":"puti94","description":null,"archived":false,"fork":false,"pushed_at":"2020-04-10T10:11:36.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-11T00:04:23.046Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/puti94.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":"2020-04-10T10:10:55.000Z","updated_at":"2020-04-10T10:11:38.000Z","dependencies_parsed_at":"2022-08-26T03:42:06.480Z","dependency_job_id":null,"html_url":"https://github.com/puti94/react-native-simple-local-storage","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/puti94%2Freact-native-simple-local-storage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puti94%2Freact-native-simple-local-storage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puti94%2Freact-native-simple-local-storage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/puti94%2Freact-native-simple-local-storage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/puti94","download_url":"https://codeload.github.com/puti94/react-native-simple-local-storage/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246162153,"owners_count":20733357,"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":[],"created_at":"2024-12-09T12:17:34.936Z","updated_at":"2025-03-29T09:14:05.764Z","avatar_url":"https://github.com/puti94.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# react-native-simple-local-storage\n\n@react-native-community/async-storage 组件的同步写法\n\n## 原理\n一开始就将保存的数据全部导入内存中，初始化完毕后就可以直接在内存操作，速度更快\n\n### Install\n\n```\n$ yarn add react-native-simple-local-storage\n```\n\n### Simple use\n```jsx\n //在入口文件中;\n import 'react-native-simple-local-storage';\n function App(){\n   const [isReady, setReady] = useState(false);\n   useEffect(() =\u003e {\n     global.localStorage.isReady.then(() =\u003e setReady(true));\n    }, []);\n   if (!isReady) {\n     return null;\n   }\n   return (\u003cView\u003e\n            \u003cButton onPress={() =\u003e global.localStorage.setItem('key', 'value')}\u003esetItem\u003c/Button\u003e\n            \u003cButton onPress={() =\u003e console.log(localStorage.getItem('key'))}\u003egetItem\u003c/Button\u003e\n            \u003cButton onPress={() =\u003e localStorage.removeItem('key')}\u003eremoveItem\u003c/Button\u003e\n            \u003cButton onPress={() =\u003e localStorage.clear()}\u003eclear\u003c/Button\u003e\n            \u003cButton onPress={() =\u003e console.log(global.localStorage.length)}\u003elength\u003c/Button\u003e\n            \u003cButton onPress={() =\u003e console.log(global.localStorage.byteSize)}\u003ebyteSize\u003c/Button\u003e\n   \u003c/Layout\u003e);\n }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputi94%2Freact-native-simple-local-storage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fputi94%2Freact-native-simple-local-storage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fputi94%2Freact-native-simple-local-storage/lists"}