I hereby claim:
- I am imran3 on github.
- I am imran3 (https://keybase.io/imran3) on keybase.
- I have a public key whose fingerprint is 290A 0FA8 04EB CE36 7B90 571F 9B44 2CC2 9220 AE1D
To claim this, I am signing this object:
import { HttpClient, HttpErrorResponse, HttpResponse, HTTP_INTERCEPTORS } from '@angular/common/http'; | |
import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; | |
import { fakeAsync, TestBed, tick } from '@angular/core/testing'; | |
import { AppConfig } from '../../services/app-config/app-config.interface'; | |
import { AppConfigService } from '../../services/app-config/app-config.service'; | |
import { MOCK_APP_CONFIG } from '../../services/app-config/mock/get-config.mock'; | |
import { RetryHttpErrorsInterceptor } from './retry-http-errors.interceptor'; | |
describe('RetryHttpErrorsInterceptor', () => { |
//AppConfig.d.ts | |
export interface AppConfig { | |
appInsightsKey: string; | |
} | |
//AppConfigService.ts | |
@Injectable() | |
export class AppConfigService { | |
private config: AppConfig; | |
loaded = false; |
@Injectable() | |
export class ApplicationInsightsErrorHandler extends ErrorHandler { | |
constructor(private injector: Injector) { | |
super(); | |
} | |
handleError(error: any): void { | |
// injecting ApplicationInsightService via injector to avoid infinite loop in case | |
// error is with service itself | |
this.injector.get<ApplicationInsightsService>(ApplicationInsightsService).logException(error); |
/* | |
Problem: | |
Review a sequence of digits and find the sum of all digits that match the next digit in the list. | |
The list is circular, so the digit after the last digit is the first digit in the list. | |
Input samples: | |
1122 produces a sum of 3 (1 + 2) because the first digit (1) matches the second digit and the third digit (2) matches | |
the fourth digit. | |
1111 produces 4 because each digit (all 1) matches the next. | |
1234 produces 0 because no digit matches the next. |
I hereby claim:
To claim this, I am signing this object: