0.3.0 • Published 10 months ago

@reactive-cache/core v0.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Reactive Cache

Installation

$ npm install @reactive-cache/core

Usage

import { reactiveCache } from 'reactive-cache';

const data = reactiveCache(fetch('https://...'));

data.subscribe(console.log);

Angular like

import { reactiveCache } from '@reactive-cache/core';
import { ajax } from 'rxjs/ajax';
import { Observable } from "rxjs";

export class FetchDataService {
  public data = reactiveCache<unknown>(this.fetchData.bind(this), { name: 'response', valueReachable: true });

  private fetchData(): Observable<unknown> {
    return ajax.get('https://jsonplaceholder.typicode.com/posts');
  }
}

const service = new FetchDataService();
service.data.subscribe(console.log)
console.log(service.data.getValue());
0.3.0

10 months ago

0.2.1

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.0

11 months ago

0.1.11

11 months ago

0.1.10

11 months ago

0.1.9

11 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.2

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago