@chrisirhc You should also extract this code:
````js
if (currentTimeout) {
      $timeout.cancel(currentTimeout);
      currentTimeout = null;
}
````
into its own function as it is called multiple times.