@onekeyfe/react-native-async-storage 3.0.162 → 3.0.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,5 +1,45 @@
|
|
|
1
1
|
# @onekeyfe/react-native-async-storage
|
|
2
2
|
|
|
3
|
+
Asynchronous string key/value storage for OneKey on iOS, Android and Web.
|
|
4
|
+
The wrapper exposes familiar AsyncStorage operations together with application
|
|
5
|
+
hooks for routing writes between JavaScript runtimes.
|
|
6
|
+
|
|
7
|
+
## Installation and usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
yarn add @onekeyfe/react-native-async-storage
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Install the application's iOS pods and rebuild the native application.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import AsyncStorage from '@onekeyfe/react-native-async-storage';
|
|
17
|
+
|
|
18
|
+
await AsyncStorage.setItem('example.preference', 'enabled');
|
|
19
|
+
const value = await AsyncStorage.getItem('example.preference');
|
|
20
|
+
await AsyncStorage.removeItem('example.preference');
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## API and runtime integration
|
|
24
|
+
|
|
25
|
+
The default export exposes `getItem`, `setItem`, `removeItem`, `mergeItem`,
|
|
26
|
+
`clear`, `getAllKeys`, `multiGet`, `multiSet`, `multiRemove` and `multiMerge`.
|
|
27
|
+
Store strings; serialize structured values explicitly. Missing items return
|
|
28
|
+
`null`, and operations can reject. `clear` removes all keys in the storage
|
|
29
|
+
backend, not just the caller's prefix.
|
|
30
|
+
|
|
31
|
+
`setAsyncStorageShouldForwardWriteGetter` and `setAsyncStorageWriteForwarder`
|
|
32
|
+
configure application-owned write routing. When forwarding is enabled, the
|
|
33
|
+
forwarder must be configured. iOS refreshes its per-runtime manifest around
|
|
34
|
+
reads and writes; this does not make uninjected writes cross-runtime serialized.
|
|
35
|
+
The Web implementation uses localStorage.
|
|
36
|
+
|
|
37
|
+
See [src/types.ts](src/types.ts) for method and callback types and
|
|
38
|
+
[src/runtimeConfig.ts](src/runtimeConfig.ts) for the forwarding contract.
|
|
39
|
+
Storage ownership, key namespaces and migration remain the caller's responsibility.
|
|
40
|
+
|
|
41
|
+
## Upstream attribution
|
|
42
|
+
|
|
3
43
|
First, a sincere thank-you to Krzysztof Borowy and the
|
|
4
44
|
`@react-native-async-storage/async-storage` maintainers for their excellent
|
|
5
45
|
work 🙏
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/react-native-async-storage",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.163",
|
|
4
4
|
"description": "react-native-async-storage",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -43,14 +43,15 @@
|
|
|
43
43
|
],
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
|
46
|
-
"url": "git+https://github.com/OneKeyHQ/app-modules
|
|
46
|
+
"url": "git+https://github.com/OneKeyHQ/app-modules.git",
|
|
47
|
+
"directory": "native-modules/react-native-async-storage"
|
|
47
48
|
},
|
|
48
49
|
"author": "@onekeyhq <huanming@onekey.so> (https://github.com/OneKeyHQ/app-modules)",
|
|
49
50
|
"license": "MIT",
|
|
50
51
|
"bugs": {
|
|
51
|
-
"url": "https://github.com/OneKeyHQ/app-modules/
|
|
52
|
+
"url": "https://github.com/OneKeyHQ/app-modules/issues"
|
|
52
53
|
},
|
|
53
|
-
"homepage": "https://github.com/OneKeyHQ/app-modules/react-native-async-storage#readme",
|
|
54
|
+
"homepage": "https://github.com/OneKeyHQ/app-modules/tree/main/native-modules/react-native-async-storage#readme",
|
|
54
55
|
"publishConfig": {
|
|
55
56
|
"registry": "https://registry.npmjs.org/"
|
|
56
57
|
},
|