mirror of
https://github.com/BreizhHardware/memoizee.git
synced 2026-01-18 16:37:21 +01:00
force option
Force memoization of already memoized function
This commit is contained in:
@@ -13,10 +13,11 @@ module.exports = exports = function (core) {
|
||||
var options, length, get, clear, conf;
|
||||
|
||||
callable(fn);
|
||||
// Do not memoize already memoized function
|
||||
if (fn.memoized) return fn;
|
||||
|
||||
options = Object(arguments[1]);
|
||||
|
||||
// Do not memoize already memoized function
|
||||
if (fn.memoized && !options.force) return fn;
|
||||
|
||||
if (ext.method && (options.method != null)) {
|
||||
return ext.method(options.method, options, fn, self);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user