callback after list created from store
551770
function viewListReady(list, error) {
        if (typeof error != 'undefined') {
          callback(error);
          return;
        }
        if (!list.moveFirst()) {
          callback(Error('no records!'));
          return;
        }

        var set = new self.StoogeSet();
        var stooge = new self.Stooge();
        self.shouldBeTrue('indoor' == list.get(set.modelType + '.' + 'name'));
        self.shouldBeTrue('1' == list.get('Scene'));
        self.shouldBeTrue('Moe' == list.get(stooge.modelType + '.' + 'name'));
        self.shouldBeTrue('To be or not to be?' == list.get('Line'));
        if (!list.moveNext()) {
          callback(Error('no more records!'));
          return;
        }
        self.shouldBeTrue('desert' == list.get(set.modelType + '.' + 'name'));
        self.shouldBeTrue('2' == list.get('Scene'));
        self.shouldBeTrue('Larry' == list.get(stooge.modelType + '.' + 'name'));
        self.shouldBeTrue('That is the question!' == list.get('Line'));
        callback(true);
      }
378593
function (revisionMap, callback) {
    var self = this;
    var ids = _.keys(revisionMap);
    async.each(ids, function (id, callback) {
      self.store.get(id, function (err, rev) {
        if (err) {
          return callback(err);
        }
        self.store.set(id, revisionMap[id] + 1, rev, callback);
      });
    }, callback);
  }
100893
function subscribe(callback) {
    var id = store._getCurrentCallbackId();
    store._incrementCurFunctionId();
    function unsubscribe() {
      store._callback_objs = store._callback_objs.filter(function (c) {
        return c.id !== id;
      });
      store._removeKeySubscriber(id);
    }
    store._callback_objs.push({ id: id, callback: callback });
    return unsubscribe;
  }
55958
function createRemote(item, store) {
      // Check existing item id property;
      var itemId = item[store.idProperty];
      // Store resources url
      var url = !itemId ? store._rootUrl : store._rootUrl + "/" + itemId;
      // Set up request
      var xhr = new XMLHttpRequest();
      xhr.open("POST", url, true);
      xhr.setRequestHeader("Content-Type", "application/json");
      // Request callback
      xhr.onload = function(e) {
        // If operation has been completed - ready state 4
        if (xhr.readyState === 4) {
          // Response status successfully completed - status 200
          if (xhr.status === 200) {
            // Set response item to be returned
            item = JSON.parse(xhr.response);
            // Refresh local data object
            vcomet.StoreMemory.create(item, store);
            // Trigger user callback once data has been retrieved
            vcomet.triggerCallback("onCreateRemote", store, store, [item]);
            // Trigger onSourceChanged event
            vcomet.triggerCallback("onSourceChanged", store);
          }
        }
      };
      // Execute request with post payload data
      store.onLoaded(function(){xhr.send(JSON.stringify(item))});
    }
977918
function addCallback (t, data) {
  var result = data.result || data.error;
  cbid = data.id;
  if (t.callbacks[cbid]) {
    if (data.result) {
      t.callbacks[cbid](result);
    } else {
      t.callbacks[cbid](result, 'error');
    }
  }
}
868039
function(
    component,
    keys_to_watch_for_changes,
    additonal_callback = null
  ) {
    if (!Array.isArray(keys_to_watch_for_changes)) {
      throw keys_to_watch_for_changes + ' must be an array'
    }
    component.state = component.state || {} // initialize if not set

    // call this function whenever the store changes
    function _callback(changed_keys) {
      if (intersection(keys_to_watch_for_changes, changed_keys).length) {
        // only update the state if a key we care about has changed
        let state_update_obj = {}
        keys_to_watch_for_changes.forEach(k => (state_update_obj[k] = store._store[k]))
        this.setState(state_update_obj)

        // if some other custom callback is required by the component
        // call that function as well
        if (additonal_callback) {
          additonal_callback(changed_keys)
        }
      }
    }
    let callback_bound_to_component = _callback.bind(component)

    // add keys that map to the store's keys
    for (let k of keys_to_watch_for_changes) {
      if (!store._store.hasOwnProperty(k)) {
        throw 'Store does not have key ' + k
      }
      if (component.state.hasOwnProperty(k)) {
        console.warn('Overwriting existing state key ' + k)
      }
      component.state[k] = store._store[k]

      store._recordKeySubscriber(k, component.constructor.name)
    }
    return store.subscribe(callback_bound_to_component)
  }
755852
def process_after_callbacks(mentioner, mentionee)
        result = true
        @callbacks[:after].each do |callback|
          unless callback.call(mentioner, mentionee)
            result = false
            break
          end
        end
        result
      end
973068
function(list){
            localStorage.setItem(localStorageKey, JSON.stringify(list));
            // if we used a real database, we would likely do the below in a callback
            this.list = list;
            this.trigger(list); // sends the updated list to all listening components (TodoApp)
        }
1193766
function dispatchToStores(ids = new Set()) {
	ids.forEach((storeID) => {
		if (this[IS_PENDING][storeID]) {
			return true;
		}

		invokeCallback.call(this, storeID);
	});
}
408382
function (pageIndex, options, callback) {

            if (pageIndex < 0) {
                throw "pageIndex must be >= 0";
            }

            var page = this.$pageCache[pageIndex];
            if (!page) {
                page = this.$pageCache[pageIndex] = new Page(null, this, pageIndex);
            }

            var self = this;
            options = _.extend(this.$, options);
            page.fetch(options, function (err, page) {
                // insert data into items if not already inserted
                if (!err && !page.itemsInsertedIntoCollection) {
                    page.itemsInsertedIntoCollection = true;

                    // add items to collection
                    self.add(page.$items, {
                        index: (pageIndex || 0) * self.$.pageSize
                    });
                }

                if (callback) {
                    callback(err, page, options);
                }
            });
        }
993042
def insert_after(self, key, new_item, instance=0):
        """"""
        self._insert_item(key, new_item, instance, True)
1200681
function(item, callback) {
                if (item.uniqueId != '') {
                    if (hasCache && typeof queueDb == 'object') {
                        queueDb.waitQ
                            .put({
                                threadId: parseInt(item.subjectId),
                                uniqueId: item.uniqueId,
                                owner: parseInt(userInfo.id),
                                message: Utility.crypt(item, cacheSecret)
                            })
                            .then(function() {
                                callback && callback();
                            })
                            .catch(function(error) {
                                fireEvent('error', {
                                    code: error.code,
                                    message: error.message,
                                    error: error
                                });
                            });
                    }
                    else {
                        chatWaitQueue.push(item);
                        callback && callback();
                    }
                }
            }
1002852
@Override
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ensureList();
    }
197012
private void initializeList() {
		FavouritesCommService.getSearchFavourites(new DataCallback<List<SearchFavourite>>() {
			public void execute(List<SearchFavourite> result) {
				favouriteItems.getDataAsRecordList().removeList(favouriteItems.getRecords());
				for (SearchFavourite sf : result) {
					favouriteItems.addData(new FavouriteListRecord(sf));
				}
			}
		});
	}
243394
function(keys_to_watch_for_changes, callback) {
    if (!Array.isArray(keys_to_watch_for_changes)) {
      throw keys_to_watch_for_changes + ' must be an array'
    }

    // add keys that map to the store's keys
    for (let k of keys_to_watch_for_changes) {
      if (!store._store.hasOwnProperty(k)) {
        throw 'Store does not have key ' + k
      }
      store._recordKeySubscriber(k, callback.name)
    }

    // call this function whenever the store changes
    function _callback(changed_keys) {
      if (intersection(keys_to_watch_for_changes, changed_keys).length) {
        callback(changed_keys)
      }
    }
    return store.subscribe(_callback)
  }
933338
function triggerIfHandlerList(handlerList, event) {
    if(handlerList !== undefined) {
        for(var n=0; n<handlerList.length; n++) {
            handlerList[n](event)
        }
    }
}
257630
function(callback) {
                var _this = this

                var initStorage = function() {
                    var obj = JSON.stringify([])
                    var _set = {}
                    _set[_this.key] = obj
                    storage.set(_set)

                    obj = JSON.parse(obj)

                    return obj
                }

                storage.get(this.key, function(items) {
                    var obj
                    if (Object.keys(items).length > 0) {
                        for (itemKey in items) {
                            obj = items[itemKey]
                            if (obj) {
                                obj = JSON.parse(obj)
                            }

                            if (obj === null || typeof obj === 'undefined') {
                                obj = initStorage()
                            } 
                            
                            if (callback) {
                                callback(obj)
                            }
                        }
                    } else {
                        obj = initStorage()
                        callback(obj)
                    }
                })
            }