Skip to content

Instantly share code, notes, and snippets.

Øystein Amundsen OysteinAmundsen

  • Bouvet ASA
  • Haugesund
Block or report user

Report or block OysteinAmundsen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
OysteinAmundsen / network-queue.interceptor.ts
Last active Mar 11, 2019
This will pick up all client requests, and make them poor-network-connection safe.
View network-queue.interceptor.ts
import { Injectable, EventEmitter } from '@angular/core';
import { HttpInterceptor, HttpRequest, HttpHandler, HttpSentEvent, HttpHeaderResponse, HttpProgressEvent, HttpResponse, HttpUserEvent, HttpClient } from '@angular/common/http';
import { Observable, Observer, Subscription, throwError, timer } from 'rxjs';
import { retryWhen, mergeMap, finalize } from 'rxjs/operators';
export class NetworkQueueInterceptor implements HttpInterceptor {
onChanges = new EventEmitter<boolean>();
private lastValue = this.isOnline();
You can’t perform that action at this time.