Skip to content

zweifisch/fresh-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fresh-promsie

NPM Version Build Status

promise that keeps itself fresh

var FreshPromise = require("fresh-promise");

var cached = new FreshPromise(5000/*ttl*/, function() {
    return Promise.resolve(Math.random());
});

cached.then(...);
cached.then(...);  // should be the same

sleep(5000).then(...);  // promise should be updated

About

promise that keeps itself fresh

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published