FIFO data structure that serves you with pregenerated values from your custom computation-intensive function. Getting those pregenerated values then boils down to a cheap
npm install --save pregen-stash
const createStash =
Create a new
size indicates the number of items that should be kept readily available at any time.
gen must be a function. Its return values will be used to reup the stash.
gen must have arity 0.
createStash returns a
Promise that resolves to a
Retrieve the next item from your stash in FIFO fashion.
Get the number of items in the stash.