Socket
Socket
Sign inDemoInstall

fresh-promise

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

fresh-promise

promise that keeps itself fresh


Version published
Maintainers
1
0
Bundle size
311 bytes
Minified + gzipped

Weekly downloads

Readme

Source

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

Keywords

FAQs

Last updated on 19 Mar 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc