composed-store
v0.1.0
Published
Composed store inspired by [koa-compose](https://github.com/koajs/compose)
Downloads
3
Readme
composed-store
Composed store inspired by koa-compose
Install
$ npm i composed-store -S
Usage
const { createStore } = require('composed-store');
// create store instance and compose with sub stores.
const store = createStore();
store.add(new Store_Impl1());
store.add(new Store_Impl2());
store.add(new Store_Impl3());
// get
const value = await store.get({ query: { key: 'foo' }});
// set
await store.set('a', 'b');
Notice: the first arg in .get() is wrapped as Koa-Context-Like object