Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Cycle.js Driver for using localStorage and sessionStorage.

License

NotificationsYou must be signed in to change notification settings

cyclejs/storage

Repository files navigation

ACycle.jsDriver for usinglocalStorage andsessionStoragein the browser.

npm install --save @cycle/storage

Usage

You 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$};}

License

MIT

About

A Cycle.js Driver for using localStorage and sessionStorage.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors6


[8]ページ先頭

©2009-2025 Movatter.jp