src/strategy.js
function (func) {
    var memo = {};
    return function (term, callback) {
      if (memo[term]) {
        callback(memo[term]);
      } else {
        func.call(this, term, function (data) {
          memo[term] = (memo[term] || []).concat(data);
          callback.apply(null, arguments);
        });
      }
    };
  }
function (func) {
    var memo = {};
    return function (term, callback) {
      if (memo[term]) {
        callback(memo[term]);
      } else {
        func.call(this, term, function (data) {
          memo[term] = (memo[term] || []).concat(data);
          callback.apply(null, arguments);
        });
      }
    };
  }
function ( func ) { var memo = { } ; return function ( term , callback ) { if ( memo [ term ] ) { callback ( memo [ term ] ) ; } else { func . call ( this , term , function ( data ) { memo [ term ] = ( memo [ term ] || [ ] ) . concat ( data ) ; callback . apply ( null , arguments ) ; } ) ; } } ; }
Memoize a search function.
Memoize a search function .