0.3.0 • Published 12 months ago

@reactive-cache/core v0.3.0

Weekly downloads
-
License
ISC
Repository
github
Last release
12 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

12 months ago

0.2.1

12 months ago

0.2.3

12 months ago

0.2.2

12 months ago

0.2.0

1 year ago

0.1.11

1 year ago

0.1.10

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago