UNPKG

603 BTypeScriptView Raw
1/**
2 * @module util
3 */
4/**
5 * Add an item to a collection, return a function that can then be used to
6 * remove the item from the collection. Optionally accepting a callback that is
7 * invoked when the item is removed from the collection.
8 */
9export declare function addAndRemoveFromCollection<T>(collection: T[], item: T, then?: Function): () => boolean;
10/**
11 * Remove the item from the collection. Optionally accepting a callback that is
12 * invoked when the item is removed from the collection.
13 */
14export declare function removeFromCollection<T>(collection: T[], item: T, then?: Function): boolean;