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:
rolux 2012-09-03 22:14:08 +02:00
parent f5c320187e
commit 0d0926cbf5

View file

@ -12,12 +12,12 @@ Ox.cache <f> Memoize a function
@*/
// TODO: add async test
Ox.cache = function(fn, options) {
options = Ox.extend({
async: false,
key: JSON.stringify
}, options || {})
var cache = {},
ret = function() {
options = Ox.extend({
async: false,
key: JSON.stringify
}, options || {});
var args = Ox.toArray(arguments), key = options.key(args);
function callback() {
// cache all arguments passed to callback