0.0.1 • Published 7 years ago

reflexus v0.0.1

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

Reflexus

=========================

Predictable state managment library, based on observers. It's basically a lightweight library on top of super awesome most.js.

Installation

npm install reflexus

or

yarn add reflexus

Usage

Reflexus has two building blocks: the sources and the main function.
Sources provide incoming event stream and allow to listen with convinient Reflexus.sensor function. Any trigger or side effectfull action is created, using Reflexus.trigger function.

To start application you need to supply main implementation to the Reflexus.run

Example:

const ws = Reflexus.sensor(websokets('ws://localhost:4000'))
const tick = Reflexus.trigger((event) => console.log(event))
const main = (sources) => {
  return {
     log: sources.log.merge(sources.ws)
  }
}

const sources = {
  ws: ws,
  log: tick
}

Reflexus.run(main,  sources)

Tests

npm test or yarn test