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

Example

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