Delay service
import { DelayService } from '@trademe/tangram';
DelayService is a wrapper around common time-related utility functions.
These allow you to leverage Angular's dependency injection to make testing delays and intervals easier to mock in unit tests.
Example
Methods
createDelay (delayTime: number): Observable<any>Returns an observable that emits once after the specified delay time has elapsed.
createInterval (intervalTime: number): Observable<any>Returns an observable that emits at a regular interval.
runOnNextTick (fn: Function): voidUtility function that explicitly waits for the next tick of the application.
runOnNextTick