From 4b59c9a2a9b8bbee91edce266d2cbda3258a3674 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Thu, 29 Mar 2012 19:32:05 +0000 Subject: [PATCH] add callback to Ox.api --- source/Ox/js/Array.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Ox/js/Array.js b/source/Ox/js/Array.js index 6be9157a..c7e383a7 100644 --- a/source/Ox/js/Array.js +++ b/source/Ox/js/Array.js @@ -2,6 +2,8 @@ /*@ Ox.api Turns an array into a list API + Ox.api takes an array and returns a function that allows you to + run complex queries against it. See the examples below for details. (items, options) -> List API items <[o]> An array of objects (key/value stores) options Options object @@ -215,7 +217,7 @@ Ox.api = function(items, options) { return match; } - return function(options) { + return function(options, callback) { var data, result = {data: {}, status: {code: 200, text: 'ok'}}, sort = {}; @@ -278,6 +280,7 @@ Ox.api = function(items, options) { ); } } + callback && callback(result); return result; };