v24
Handle State Change
<String> LViS.Trivia.ON_STATE_CHANGE
Notifies about state change.

Example

// shorthand
var T = window.LViS.Trivia;
element.bind(T.ON_STATE_CHANGE, function (state) {
switch (state) {
case T.STATE_STARTED:
renderStartedState();
break;
case T.STATE_STOPPED:
renderStoppedState();
break;
case T.STATE_REVEALED:
renderRevealedState();
break;
}
};);
Copy link