be-obsessing
v0.0.3
Published
Read and update session storage (parsing via JSON).
Downloads
10
Maintainers
Readme
be-obsessing
Read and update session storage (parsing via JSON).
be-persisting, be-persistent, be-obsessing overlap quite a bit. They are all concerned with storing user data locally.
The differences in a nutshell:
be-obsessing (this package) focuses on storing data in session storage, and is configured primarily through "Hemingway notation" - complete English statements (including the name of the attribute).
be-persisting does the same, but focusing on indexedDB.
be-persistent works both with IndexedDB and Session Storage (and local storage), but is configured purely via JSON.
Example 1a:
<meta itemprop=myProp be-obsessing>
... reads JSON.parse(sessionStorage.getItem('myProp')). Same in reverse (but faster to set oMeta.beValueAdded.value = ...)
Watches for content property, and keeps in sync.
Example 1b:
<meta itemprop=myProp be-obsessing='about myStorage : my subsection.'>
... reads JSON.parse(sessionStorage.getItem('myStorage')).mySubsection and passes to content property. Same in reverse (but faster to set oMeta.beValueAdded.value = ...)
Watches for content property, and keeps in sync
Viewing Demos Locally
Any web server that can serve static files will do, but...
- Install git.
- Fork/clone this repo.
- Install node.js.
- Open command window to folder where you cloned this repo.
npm install
npm run serve
- Open http://localhost:3030/demo/ in a modern browser.
Running Tests
> npm run test
Using from ESM Module:
import 'be-obsessing/be-obsessing.js';
Using from CDN:
<script type=module crossorigin=anonymous>
import 'https://esm.run/be-obsessing';
</script>