1.0.2 • Published 7 years ago

beholdable v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

BEHOLD!

Beholdable.js

What?

const state = new Beholdable();

state.behold("loggedIn", function(val) {
	if (val) {
		alert("Hello!");
	} else {
		alert("Goodbye.");
	}
});

state.set("loggedIn", true); // triggers alert "Hello!"
state.set("loggedIn", false); // triggers alert "Goodbye."

// You can also get values from your Beholdable:
state.get("loggedIn"); // => false

That's it. Observable objects. When you change them, the callbacks are fired, but only if the new value is different than the old one.

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago