Handle Event State Change

<String> LViS.Event.ON_STATE

Once we have reference to an LViS Event, we can monitor its state and change our UI accordingly. To do that we need to know list of constants that represent each state. Let's create sample function to handle state change. It's up to you how to handle your UI.

Example

// shorthand
var E = LViS.Event;
var event = LViS.getEvent();
event.bind(E.ON_STATE, function (state) {
switch (state) {
case E.STATE_UPCOMING:
renderUpcomingState();
break;
case E.STATE_ACTIVE:
renderActiveState();
break;
...
}
});