Current version 22.0.0

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): void

Utility function that explicitly waits for the next tick of the application.

Be careful when using this function and explore other options first. Using runOnNextTick can indicate wider problems in code architecture.
Proudly made by © 2026 Trade Me Limited