reflexus

0.0.1 • Public • Published

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

Package Sidebar

Install

npm i reflexus

Weekly Downloads

1

Version

0.0.1

License

MIT

Last publish

Collaborators

  • shamash