MCPcopy Index your code
hub / github.com/cyclejs/storage

github.com/cyclejs/storage @4.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 4.1.0 ↗ · + Follow
18 symbols 39 edges 6 files 2 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Cycle Storage Driver

A Cycle.js Driver for using localStorage and sessionStorage in the browser.

npm install --save @cycle/storage

Usage

You can read the API docs here.

Basics:

import Cycle from '@cycle/core';
import storageDriver from '@cycle/storage';

function main(responses) {
  // ...
}

const drivers = {
  storage: storageDriver
}

Cycle.run(main, drivers);

Simple and normal use case (JSBin demo):

function main({DOM, storage}) {
   const storageRequest$ = 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

Extension points exported contracts — how you extend this code

StorageSaveRequest (Interface)
(no doc)
src/index.ts
StorageRemoveRequest (Interface)
(no doc)
src/index.ts
StorageClearRequest (Interface)
(no doc)
src/index.ts
ResponseCollection (Interface)
(no doc)
src/index.ts
StorageSource (Interface)
(no doc)
src/index.ts

Core symbols most depended-on inside this repo

getItem
called by 19
src/index.ts
writeToStore
called by 16
src/writeToStore.ts
key
called by 4
src/index.ts
getStorage$
called by 2
src/util.ts
getResponseObj
called by 2
src/util.ts
storageDriver
called by 1
src/index.ts
storageKey
called by 1
src/util.ts
storageGetItem
called by 1
src/util.ts

Shape

Function 11
Interface 5
Method 2

Languages

TypeScript100%

Modules by API surface

src/index.ts8 symbols
src/util.ts6 symbols
src/responseCollection.ts2 symbols
src/writeToStore.ts1 symbols
example/app.js1 symbols

For agents

$ claude mcp add storage \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact