mirror of
https://github.com/Raghu-Ch/angular-challenges.git
synced 2026-02-13 06:13:03 -05:00
feat(ngrxcallstatelibray): update readme
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
/* eslint-disable @typescript-eslint/no-empty-interface */
|
||||
import { ClassProvider, InjectionToken, Type } from '@angular/core';
|
||||
import {
|
||||
ClassProvider,
|
||||
InjectionToken,
|
||||
Type,
|
||||
ValueProvider,
|
||||
} from '@angular/core';
|
||||
import { CallStateErrorHandler } from './call-state.model';
|
||||
|
||||
export interface ErrorHandler<T extends CustomError> {
|
||||
@@ -16,3 +21,12 @@ export const ERROR_TOKEN = new InjectionToken<ErrorHandler<any>>('error', {
|
||||
export const provideErrorHandler = <T extends ErrorHandler<any>>(
|
||||
errorHandlerClass: Type<T>
|
||||
): ClassProvider => ({ provide: ERROR_TOKEN, useClass: errorHandlerClass });
|
||||
|
||||
export const FLICKER_TIME = new InjectionToken<number>('flicker', {
|
||||
factory: () => 300,
|
||||
});
|
||||
|
||||
export const provideFlickerDelay = (delay: number): ValueProvider => ({
|
||||
provide: FLICKER_TIME,
|
||||
useValue: delay,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user