1.0.1 • Published 2 years ago
tronic247-state-js v1.0.1
state.js
State management library for JavaScript.
Init states
Include the state.js
file in your project.
const S_name = State("value");
const StateWithNull = State();
Updating states
S_name.set("John");
Listening for changes
S_name.addChangeListener((value, oldValue) => {
console.log(value, oldValue);
});
Debugging
S_name.setDebug(true);
// Only for this state
S_name.setDebug(true, false);
Credits
This library is inspired by React.