mirror of
https://github.com/BreizhHardware/memoizee.git
synced 2026-01-18 16:37:21 +01:00
Merge with v0.2
This commit is contained in:
5
CHANGES
5
CHANGES
@@ -1,3 +1,8 @@
|
||||
v0.2.6 -- 2013.10.08
|
||||
* Fix internal events propagation when handling async calls that
|
||||
resolve with errors. `asyncpurge` was emitted for values that had no
|
||||
`asyncinit` emitted. Issue #9
|
||||
|
||||
v0.2.5 -- 2013.06.21
|
||||
* Fix primitive handling for dynamic arguments length
|
||||
|
||||
|
||||
@@ -2,11 +2,12 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var aFrom = require('es5-ext/array/from')
|
||||
, last = require('es5-ext/array/#/last')
|
||||
, forEach = require('es5-ext/object/for-each')
|
||||
, isCallable = require('es5-ext/object/is-callable')
|
||||
, nextTick = require('next-tick')
|
||||
var aFrom = require('es5-ext/array/from')
|
||||
, last = require('es5-ext/array/#/last')
|
||||
, isArguments = require('es5-ext/function/is-arguments')
|
||||
, forEach = require('es5-ext/object/for-each')
|
||||
, isCallable = require('es5-ext/object/is-callable')
|
||||
, nextTick = require('next-tick')
|
||||
|
||||
, isArray = Array.isArray, slice = Array.prototype.slice
|
||||
, apply = Function.prototype.apply;
|
||||
@@ -98,7 +99,7 @@ require('../_base').ext.async = function (ignore, conf) {
|
||||
// If false, we don't have value yet, so we assume that intention is not
|
||||
// to memoize this call. After value is obtained we don't cache it but
|
||||
// gracefully pass to callback
|
||||
if (!isArray(cache[id])) {
|
||||
if (isArguments(cache[id])) {
|
||||
conf.emit('purgeasync', id);
|
||||
delete cache[id];
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
"next-tick": "0.1.x"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tad": "~0.1.16"
|
||||
"tad": "~0.1.19"
|
||||
},
|
||||
"author": "Mariusz Nowak <medikoo+memoize@medikoo.com> (http://www.medikoo.com/)",
|
||||
"license": "MIT"
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
var memoize = require('../../lib')
|
||||
, nextTick = require('next-tick');
|
||||
|
||||
require('../../lib/ext/dispose');
|
||||
|
||||
module.exports = function () {
|
||||
return {
|
||||
"Regular": {
|
||||
@@ -85,7 +87,7 @@ module.exports = function () {
|
||||
return u;
|
||||
};
|
||||
|
||||
mfn = memoize(fn, { async: true });
|
||||
mfn = memoize(fn, { async: true, dispose: a.never });
|
||||
|
||||
a(mfn(3, 7, function (err, res) {
|
||||
a.deep([err, res], [e, undefined], "Result #1");
|
||||
|
||||
Reference in New Issue
Block a user