Skip to content

Commit ad2bdd3

Browse files
authored
Merge pull request #83 from BaileyBrightman/userdata-idb-addition
Userdata idb addition
2 parents 768abb3 + 42b9467 commit ad2bdd3

20 files changed

+1287
-479
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
# These owners will be the default owners for everything in the repo.
5-
* @902seanryan @aberkie
5+
* @902seanryan @aberkie @deycorinne

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v8.11.3
1+
v10.15.3

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Fullscreen Plugin. The ability to add in a fullscreen button within container
1111
- Fullscreen Plugin Automated Testing
1212
- Fullscreen Plugin Documentation
13-
14-
13+
- Indexeddb additions to the userdata class
14+
### Changed
1515
- update NPM modules to remove security vulnerabilities

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,7 @@ used to store user data for use across the Springroll environment. Examples are
462462
The `SavedData` class is the most direct way to access the Container storage options. It is used primarily in plugin classes, but may
463463
be used wherever necessary.
464464

465+
Following is an example of interacting with Local Storage
465466
```javascript
466467
import { SavedData } from 'springroll-container';
467468

@@ -476,6 +477,18 @@ let data = SavedData.read('user-value-key'); //data will be either the value in
476477
SavedData.remove('user-value-key'); //removes the value from both local and session storage.
477478
```
478479

480+
Following is an example of interacting with [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API) through the UserData class
481+
482+
483+
``` javascript
484+
import { SavedData } from 'springroll-container';
485+
486+
// Firstly, construct the SavedData object. This is only needed for IndexedDB work
487+
savedData = new SavedData('dbName');
488+
```
489+
All other methods will work the same as the documentation [here](https://github.com/SpringRoll/SpringRoll/tree/main/src/state#userdata);
490+
491+
479492
### SavedDataHandler
480493
The SavedDataHandler class is used primarily in the `UserDataPlugin` to interact with the `SavedData` class. But can be used directly
481494
if you require a callback when reading or writing from `SavedData`. Like `SavedData` all of the methods are static.

dist/SpringRoll-Container-umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/SpringRoll-Container-umd.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)