Skip to content

yanche/hub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hub

Hub is made to reduce redundant async calls.

Example

Program triggers multiple async calls at the same time, using hub, only one call will be actually send out. Also the result could be saved by setting a timeout(in ms), null or undefined means permanent cache.

Interface

  • ctor
    1. fn, a function takes nothing and return a promise
    2. timeout: ms (0 for nocache and null/undefined for permanent cache)
  • timeout (boolean)
  • get (Promise)

About

a js library to reduce dup async function call

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published