acid-reflux-js
TypeScript icon, indicating that this package has built-in type declarations

1.2.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.2.0

  • Deprecated hook useAcidRefluxValue, use useStoreValue(...) instead
  • Added useStoreState, returns [value, setValue(...)]

v1.1.0

  • Added hook useAcidRefluxValue

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

Readme

Keywords

Package Sidebar

Install

npm i acid-reflux-js

Weekly Downloads

18

Version

1.2.0

License

MIT

Unpacked Size

2.39 MB

Total Files

77

Last publish

Collaborators

  • sam-g-steel