Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Using application states

Jason Mulligan edited this page Dec 27, 2012 · 3 revisions

Using application states

abaaso affords stateful binding within it's global observer. This means you can define a listener for the same event across multiple states that your application would mutate through.

Confused? Don't be, it's pretty basic.

Listeners are registered for all states by default, so you have to go out of your way to use stateful binding.

If I want clicks on the anchors within the nav element to only work during the active application state, I'd do the following:

$("nav").on("click", function (e) {
	
}, "clicked", undefined, "active");

If abaaso.state.current is not active, the nav would not work.