Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Resilience Patterns in Angular

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

Resilience Patterns in Angular

Improve UX in Angular Applications by using common resilience patterns

Avatar for Maik Schöneich

Maik Schöneich

March 23, 2018
Tweet

More Decks by Maik Schöneich

Other Decks in Programming

Transcript

  1. @Injectable() class MessageBus { private messageBus: Rx.Subject; constructor() { this.messageBux

    = new Rx.Subject(); } subscribe<T>(action: (value:T) => void) { this.messageBus.subscribe(action); } send<T>(value: T) { this.messageBus.next(value); } }
  2. @Injectable() class MyService { constructor(private http: HttpClient) {} getData() {

    return this.http.get("/api/data") .pipe( timeout(3000) // in ms ) } }