mirror of
https://github.com/BreizhHardware/memoizee.git
synced 2026-01-18 16:37:21 +01:00
Fix resolvers bug. Fixes #12
This commit is contained in:
@@ -39,7 +39,7 @@ module.exports = function (original, length, options) {
|
||||
return cache[id];
|
||||
}
|
||||
}
|
||||
if (args.length === 1) result = call.call(original, this, arg);
|
||||
if (args.length === 1) result = call.call(original, this, args[0]);
|
||||
else result = apply.call(original, this, args);
|
||||
if (id === null) {
|
||||
id = get(args);
|
||||
|
||||
@@ -54,6 +54,10 @@ module.exports = function () {
|
||||
a(fn(), r, "Third");
|
||||
a(i, 1, "Called once");
|
||||
},
|
||||
"One arg": function (a) {
|
||||
var fn = memoize(function (elo) { ++i; return arguments; }, { resolvers: [Boolean] });
|
||||
a.deep(aFrom(r = fn('elo')), [true], "First");
|
||||
},
|
||||
"Some Args": function (a) {
|
||||
var x = {};
|
||||
i = 0;
|
||||
|
||||
Reference in New Issue
Block a user