Skip to content

Instantly share code, notes, and snippets.

View shellphon's full-sized avatar
💌

Dont Wong shellphon

💌
View GitHub Profile
@shellphon
shellphon / example.component.ts
Created April 27, 2018 03:29 — forked from gilhanan/example.component.ts
Example on how to achieve RxJS observable caching and storage in Angular 2+. Ideal for storing Http requests client side for offline usage.
import { Component, OnInit, OnDestroy } from '@angular/core';
import {Http} from "@angular/http";
import { LocalCacheService } from "./local-cache.service";
@Component({
selector: 'app-example',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class ExampleComponent implements OnInit, OnDestroy {