This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Inject, Injectable, InjectionToken } from '@angular/core'; | |
import { Observable, combineLatest, filter, interval, take, takeWhile } from 'rxjs'; | |
// REQUEST_INTEVAL and MAX_QUANTITY_ATTEMPTS are InjectionToken | |
// InjectionTokens can be configured globally at the module, component or service level only once | |
// defines a interval in seconds to api request | |
export const REQUEST_INTEVAL = new InjectionToken<number>('REQUEST_INTEVAL', { | |
providedIn: 'root', |