0.4.1 • Published 2 years ago

@r14c/async-utils v0.4.1

Weekly downloads
2
License
Unlicense
Repository
-
Last release
2 years ago

@r14c/async-utils(1) -- async implementations of common utility functions

don't block

async-utils is designed to work with the new async syntax to allow you to write non-blocking code that looks synchronous. functions like Array.prototype.map() are very useful, but operating over large collections will always block. async-utils rethinks a full range of useful tools to work with the event loop rather than against it.

contributors welcome! please email a patch or pull request to a maintainer and we'll get your changes merged as quickly as possible.

Modules

Functions

fork

fork(fns, predicate) ⇒ Promise.<any>

execute a chain of async operations using the return value of each function as the argument for the next

Kind: global method of fork

ParamType
fnsArray.<function(value)>
predicateany

memoize

Memoize(identity) ⇒ function

cache namespace cosntructor the passed identity function is used to track which function made a particular call so it can be associated with the cache. by default, memoize uses the included checksum function.

Kind: global method of memoize
Returns: function - cache instance
See: checksum

ParamTypeDefaultDescription
identityfunctionoptional identity function

Memoize~memoize(fn, args, ttl)

cache the result of a function call in memory.

Kind: inner method of Memoize

ParamTypeDescription
fnfunctionthe function that is being memoized
argsarrayarguments that should be passed into fn
ttlnumber | Objecttime to live value and cache group

memoize.clear(cacheGroup)

evict a group of cached objects

Kind: static method of memoize

ParamType
cacheGroupstring

microTask

microTask(fn) ⏏

schedule a task to run on nextTick

Kind: global method of microTask

ParamType
fnfunction

to

to(promise) ⇒ Promise

Kind: global method of to

ParamType
promisePromise
0.4.1

2 years ago

0.4.0

2 years ago

0.3.4

5 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.1

6 years ago