@webex/storage-adapter-local-storage 3.8.1-next.3 → 3.8.1
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 +11 -49
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# @webex/storage-adapter-local-storage
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/RichardLitt/standard-readme)
|
|
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)
|
|
4
12
|
|
|
5
13
|
## Install
|
|
6
14
|
|
|
@@ -10,53 +18,7 @@ npm install --save @webex/storage-adapter-local-storage
|
|
|
10
18
|
|
|
11
19
|
## Usage
|
|
12
20
|
|
|
13
|
-
This
|
|
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.
|
|
21
|
+
This is a part of the Cisco Webex JS SDK . Please see our [developer portal](https://developer.webex.com/) and the [API docs](https://webex.github.io/webex-js-sdk/api/) for full details.
|
|
60
22
|
|
|
61
23
|
## Maintainers
|
|
62
24
|
|
|
@@ -68,4 +30,4 @@ Pull requests welcome. Please see [CONTRIBUTING.md](https://github.com/webex/web
|
|
|
68
30
|
|
|
69
31
|
## License
|
|
70
32
|
|
|
71
|
-
© 2016-
|
|
33
|
+
© 2016-2020 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.8.1
|
|
22
|
+
"@webex/storage-adapter-spec": "3.8.1",
|
|
23
|
+
"@webex/test-helper-mocha": "3.8.1",
|
|
24
|
+
"@webex/webex-core": "3.8.1"
|
|
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",
|
|
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",
|
|
45
45
|
"eslint": "^8.24.0",
|
|
46
46
|
"prettier": "^2.7.1"
|
|
47
47
|
},
|
|
48
|
-
"version": "3.8.1
|
|
48
|
+
"version": "3.8.1"
|
|
49
49
|
}
|