Skip to content

Files

Latest commit

 

History

History
20 lines (14 loc) · 974 Bytes

faastjs.limits.memoize.md

File metadata and controls

20 lines (14 loc) · 974 Bytes
id title hide_title
faastjs.limits.memoize
Limits.memoize property
true

faastjs > Limits > memoize

Limits.memoize property

If memoize is true, then every call to the throttled function will be saved as an entry in a map from arguments to return value. If same arguments are seen again in a future call, the return value is retrieved from the Map rather than calling the function again. This can be useful for avoiding redundant calls that are expected to return the same results given the same arguments.

The arguments will be captured with JSON.stringify, therefore types that do not stringify uniquely won't be distinguished from each other. Care must be taken when specifying memoize to ensure avoid incorrect results.

Signature:

memoize?: boolean;