code: function update() {
          for (var i = 0; i < states.length; i++) {
            if (anyMatch(states[i].state, states[i].params)) {
              addClass($element, activeClasses[states[i].hash]);
            } else {
              removeClass($element, activeClasses[states[i].hash]);
            }
  
            if (exactMatch(states[i].state, states[i].params)) {
              addClass($element, activeEqClass);
            } else {
              removeClass($element, activeEqClass);
            }
          }
        }
docs: Update route state