@theevolk/lazy
v0.1.3
Published
Lazy loaders for internal uses
Downloads
1
Readme
@theevolk/lazy
A simple library for lazy loading of something.
Example
import SimpleLazyValue from '@theevolk/lazy/simple-lazy-value';
const myValueLoader = new SimpleLazyValue(
() => {
console.log('requesting value');
new Promise(res => setTimeout(() => res('hello'), 1e3))
}
);
for (let i = 0; i < 10; i++) {
myValueLoader.request()
.then(v => console.log('resolved', v));
}