In Ox.cache (which is now called onload in Array.js to cache getSortValue), remove dependency on Ox.extend (which would depend on Ox.forEach)
This commit is contained in:
parent
f5c320187e
commit
0d0926cbf5
1 changed files with 4 additions and 4 deletions
|
@ -12,12 +12,12 @@ Ox.cache <f> Memoize a function
|
||||||
@*/
|
@*/
|
||||||
// TODO: add async test
|
// TODO: add async test
|
||||||
Ox.cache = function(fn, options) {
|
Ox.cache = function(fn, options) {
|
||||||
options = Ox.extend({
|
|
||||||
async: false,
|
|
||||||
key: JSON.stringify
|
|
||||||
}, options || {})
|
|
||||||
var cache = {},
|
var cache = {},
|
||||||
ret = function() {
|
ret = function() {
|
||||||
|
options = Ox.extend({
|
||||||
|
async: false,
|
||||||
|
key: JSON.stringify
|
||||||
|
}, options || {});
|
||||||
var args = Ox.toArray(arguments), key = options.key(args);
|
var args = Ox.toArray(arguments), key = options.key(args);
|
||||||
function callback() {
|
function callback() {
|
||||||
// cache all arguments passed to callback
|
// cache all arguments passed to callback
|
||||||
|
|
Loading…
Reference in a new issue