kefir.db

0.4.4 • Public • Published

Kefir DB

WIP. High-level reactive states for Kefir stream library.

Short description

Unlike many others stream implementations, Kefir does have a stateful stream concept called Property. Still this concept is very low-level and basic, without a functionality we typically expect from an app-level reactive state. This library is based on native Propery, adding a number of additional features and, most importantly, establishing an API for pluggable middlewares.

Usage

$ npm install kefir.db
import K from "kefir"
import * as D from "kefir.db"
 
let inc = (x) => x + 1
let dec = (x) => x - 1
 
let action$ = K.merge(
  K.constant(0),     // initial counter
  K.later(100, inc), // increment counter after 100ms
  K.later(200, dec), // decrement counter after 200ms
  K.later(300, inc), // increment counter after 300ms
)
 
let Store = D.makeStore({})    // pass some options, check `makeStore.options` or docs
let state$ = Store(action$).$ // make state, getting stream from a `Store(..)` call
 
state$.log("state$")          // use built-in Kefir logging
// state$: 0--1--0--1-->

Tutorials

1. State

Getting started with reactive states.

2. Store

Let's make a better store abstraction.

10. Logging

Learn how to use Logging middleware.

11. Control

Learn how to use Control middleware.

Links

Package Sidebar

Install

npm i kefir.db

Weekly Downloads

1

Version

0.4.4

License

MIT

Unpacked Size

26.6 kB

Total Files

14

Last publish

Collaborators

  • ivan-kleshnin