- Notifications
You must be signed in to change notification settings - Fork13
A Cycle.js Driver for using localStorage and sessionStorage.
License
NotificationsYou must be signed in to change notification settings
cyclejs/storage
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
ACycle.jsDriver for usinglocalStorage andsessionStoragein the browser.
npm install --save @cycle/storageYou can read theAPI docs here.
Basics:
importCyclefrom'@cycle/core';importstorageDriverfrom'@cycle/storage';functionmain(responses){// ...}constdrivers={storage:storageDriver}Cycle.run(main,drivers);
Simple and normal use case (JSBin demo):
functionmain({DOM, storage}){conststorageRequest$=DOM.select('input').events('keypress').map(function(ev){return{key:'inputText',value:ev.target.value};});return{DOM:storage.local.getItem('inputText').startWith('').map((text)=>h('input',{type:'text',value:text})),storage:storageRequest$};}
About
A Cycle.js Driver for using localStorage and sessionStorage.
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
No packages published
Contributors6
Uh oh!
There was an error while loading.Please reload this page.