https://github.com/kt3k/lepont-async-storage
Use react-native's AsyncStorage in browser, a lepont plugin
https://github.com/kt3k/lepont-async-storage
async-storage lepont react-native webview
Last synced: 28 days ago
JSON representation
Use react-native's AsyncStorage in browser, a lepont plugin
- Host: GitHub
- URL: https://github.com/kt3k/lepont-async-storage
- Owner: kt3k
- License: mit
- Created: 2020-03-24T02:54:26.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-06-18T04:22:54.000Z (11 months ago)
- Last Synced: 2025-03-15T09:11:26.668Z (about 2 months ago)
- Topics: async-storage, lepont, react-native, webview
- Language: TypeScript
- Homepage:
- Size: 605 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @lepont/async-storage v0.4.2

[](https://codecov.io/gh/kt3k/lepont-async-storage)> Async Storage Bridge for [lepont][]
You can use [AsyncStorage][] through [lepont][].
# Install
```
npm i --save lepont @react-native-community/async-storage @lepont/async-storage
```# Usage
React Native side:
```tsx
import React from 'react'
import { useBridge } from 'lepont'
import { WebView } from 'react-native-webview'
import { AsyncStorageBridge } from '@lepont/async-storage/bridge'
import AsyncStorage from '@react-native-community/async-storage'const App = () => {
const [ref, onMessage] = useRegistry(AsyncStorageBridge(AsyncStorage))return (
)
}
```Browser side:
```ts
import { setItem, getItem } from '@lepont/async-storage'await setItem('@storage_Key', { my: 'value' })
await getItem('@storage_Key') // => { my: 'value' }
```# LICENSE
MIT
[lepont]: https://github.com/kt3k/lepont
[AsyncStorage]: https://github.com/react-native-community/async-storage