summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Early <alexander.early@gmail.com>2015-05-19 15:18:27 -0700
committerAlexander Early <alexander.early@gmail.com>2015-05-19 15:18:27 -0700
commitfadd2078daf1757cb65466a787926501093d74d7 (patch)
tree0e7cf397b11076f30fabb9c5aea252804cd9c557
parent8a7fb2b9259d2b57a4a1f83ec4ef292127b2938a (diff)
parentcdddd3491461e479ab4f70c8f99df216b52f100d (diff)
downloadasync-fadd2078daf1757cb65466a787926501093d74d7.tar.gz
Merge pull request #631 from boutell/master
Document behavior of the default hash function of async.memoize
-rw-r--r--README.md2
1 files changed, 2 insertions, 0 deletions
diff --git a/README.md b/README.md
index 72c06af..a2d507c 100644
--- a/README.md
+++ b/README.md
@@ -1612,6 +1612,8 @@ Caches the results of an `async` function. When creating a hash to store functio
results against, the callback is omitted from the hash and an optional hash
function can be used.
+If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.
+
The cache of results is exposed as the `memo` property of the function returned
by `memoize`.