@webex/storage-adapter-local-storage 3.8.1 → 3.9.0-next.2
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 +49 -11
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
# @webex/storage-adapter-local-storage
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
> localStorage adapter for the Cisco Webex JS SDK
|
|
6
|
-
|
|
7
|
-
- [Install](#install)
|
|
8
|
-
- [Usage](#usage)
|
|
9
|
-
- [Contribute](#contribute)
|
|
10
|
-
- [Maintainers](#maintainers)
|
|
11
|
-
- [License](#license)
|
|
3
|
+
Storage adapter that uses browser localStorage for the Webex SDK.
|
|
12
4
|
|
|
13
5
|
## Install
|
|
14
6
|
|
|
@@ -18,7 +10,53 @@ npm install --save @webex/storage-adapter-local-storage
|
|
|
18
10
|
|
|
19
11
|
## Usage
|
|
20
12
|
|
|
21
|
-
This
|
|
13
|
+
This package provides localStorage functionality for the Webex SDK storage system.
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import StorageAdapterLocalStorage from '@webex/storage-adapter-local-storage';
|
|
17
|
+
|
|
18
|
+
const adapter = new StorageAdapterLocalStorage('webex-storage');
|
|
19
|
+
|
|
20
|
+
// Bind to a namespace
|
|
21
|
+
adapter.bind('myNamespace', { logger: console })
|
|
22
|
+
.then(store => {
|
|
23
|
+
// Store data
|
|
24
|
+
return store.put('key', 'value');
|
|
25
|
+
})
|
|
26
|
+
.then(() => {
|
|
27
|
+
// Retrieve data
|
|
28
|
+
return store.get('key');
|
|
29
|
+
})
|
|
30
|
+
.then(value => {
|
|
31
|
+
console.log('Retrieved:', value);
|
|
32
|
+
});
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Methods
|
|
36
|
+
|
|
37
|
+
### Constructor
|
|
38
|
+
|
|
39
|
+
Creates a new localStorage adapter.
|
|
40
|
+
|
|
41
|
+
- `basekey` - The base key under which all data will be stored in localStorage
|
|
42
|
+
|
|
43
|
+
### bind(namespace, options)
|
|
44
|
+
|
|
45
|
+
Returns a storage interface bound to a specific namespace.
|
|
46
|
+
|
|
47
|
+
- `namespace` - Namespace for data isolation
|
|
48
|
+
- `options.logger` - Logger instance for debugging
|
|
49
|
+
|
|
50
|
+
### Bound Storage Methods
|
|
51
|
+
|
|
52
|
+
- `put(key, value)` - Store a value
|
|
53
|
+
- `get(key)` - Retrieve a value
|
|
54
|
+
- `del(key)` - Delete a value
|
|
55
|
+
- `clear()` - Clear all data for this namespace
|
|
56
|
+
|
|
57
|
+
## Browser Support
|
|
58
|
+
|
|
59
|
+
This adapter requires localStorage support and will only work in browser environments.
|
|
22
60
|
|
|
23
61
|
## Maintainers
|
|
24
62
|
|
|
@@ -30,4 +68,4 @@ Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/web
|
|
|
30
68
|
|
|
31
69
|
## License
|
|
32
70
|
|
|
33
|
-
© 2016-
|
|
71
|
+
© 2016-2025 Cisco and/or its affiliates. All Rights Reserved.
|
package/package.json
CHANGED
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
]
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@webex/storage-adapter-spec": "3.8.1",
|
|
23
|
-
"@webex/test-helper-mocha": "3.8.1",
|
|
24
|
-
"@webex/webex-core": "3.
|
|
22
|
+
"@webex/storage-adapter-spec": "3.8.1-next.11",
|
|
23
|
+
"@webex/test-helper-mocha": "3.8.1-next.11",
|
|
24
|
+
"@webex/webex-core": "3.9.0-next.2"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"build": "yarn build:src",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@webex/eslint-config-legacy": "0.0.0",
|
|
39
39
|
"@webex/jest-config-legacy": "0.0.0",
|
|
40
40
|
"@webex/legacy-tools": "0.0.0",
|
|
41
|
-
"@webex/test-helper-chai": "3.8.1",
|
|
42
|
-
"@webex/test-helper-mocha": "3.8.1",
|
|
43
|
-
"@webex/test-helper-mock-webex": "3.8.1",
|
|
44
|
-
"@webex/test-helper-test-users": "3.8.1",
|
|
41
|
+
"@webex/test-helper-chai": "3.8.1-next.11",
|
|
42
|
+
"@webex/test-helper-mocha": "3.8.1-next.11",
|
|
43
|
+
"@webex/test-helper-mock-webex": "3.8.1-next.11",
|
|
44
|
+
"@webex/test-helper-test-users": "3.8.1-next.11",
|
|
45
45
|
"eslint": "^8.24.0",
|
|
46
46
|
"prettier": "^2.7.1"
|
|
47
47
|
},
|
|
48
|
-
"version": "3.
|
|
48
|
+
"version": "3.9.0-next.2"
|
|
49
49
|
}
|