1.0.1 • Published 2 years ago

tronic247-state-js v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

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.

1.0.1

2 years ago

1.0.0

2 years ago