@reactive-cache/map
v0.3.0
Published
reactive map for angular and rxjs projects
Maintainers
Readme
Reactive Cache
Installation
$ npm install @reactive-cache/mapUsage
import { ReactiveMap } from 'reactive-cache/map';
const map = new ReactiveMap<string, object>('map', (key: string) => {
return fetch('http://...' + key)
});
map.get('1').subscribe(console.log);
// data is fetched only once
setTimeout(() => {
map.get('1').subscribe()
}, 5000)