Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

acid-reflux-js

1.0.0 • Public • Published

acid-reflux-js

A simple library for uni-directional dataflow application architecture... inspired by Flux and Redux

npm version

See more in depth docs here

Example code...

var acidRefluxJS = require("acid-reflux-js")

// Create store
let store = new acidRefluxJS.Store();

// Subscribe to changes
store.subscribeToChanges((newState, oldState)=>{
    console.log("on any change", newState)
});

store.subscribeToChanges((newVal, oldVal)=>{
    console.log("isLoggedIn changed to...", newVal)
}, "isLoggedIn");

// Set time
store.setState({
    time: Date.now()
});

// Set time and isLoggedIn
store.setState({
    time: Date.now(),
    isLoggedIn: true
});

console.log("Full History", store.getFullHistory());

Latest Changes

v1.0.0 Changed build dir from /es5 to /lib Added improved TypeScript support

v0.3.2 Updating docs

v0.3.1 Fixed a bug in the TypeScript definition file

v0.3.0

Added state mapping More docs on this later

v0.2.0

Added State.maxHistoryLength Added state binding

v0.1.7

Added more docs using ESdoc [wip]

v0.1.6

Updated Change Log functions... internal property "__time" is now ignored

Log looks cleaner

v0.1.5

Added Change Log functions... More to come in the docs!

v0.1.4

Improved changed detection, now if a state property changes from one object to another that is identical, no change is registered

Future Plans

  • More Docs
  • State change playback mode

Keywords

Install

npm i acid-reflux-js

DownloadsWeekly Downloads

5

Version

1.0.0

License

MIT

Unpacked Size

322 kB

Total Files

62

Last publish

Collaborators

  • avatar