2.6.0 • Published 10 months ago

@reactive-cache/core v2.6.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 readonly response$ = reactiveCache.valueReadable<unknown>('response$', () => this.fetchData());

  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());
1.2.0

12 months ago

1.1.0

12 months ago

1.0.0

12 months ago

1.8.0

11 months ago

1.7.0

11 months ago

1.6.0

11 months ago

1.5.0

11 months ago

2.3.0

11 months ago

2.2.0

11 months ago

2.5.0

10 months ago

2.3.2

11 months ago

2.2.3

11 months ago

2.4.0

11 months ago

2.3.1

11 months ago

2.2.2

11 months ago

2.6.0

10 months ago

2.1.0

11 months ago

2.0.0

11 months ago

0.3.0

1 year ago

0.2.1

1 year ago

0.2.3

1 year ago

0.2.2

1 year 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