UNPKG

@shopify/app-bridge

Version:

[![Build Status](https://travis-ci.com/Shopify/app-bridge.svg?token=RBRyvqQyN525bnfz7J8p&branch=master)](https://travis-ci.com/Shopify/app-bridge) [![codecov](https://codecov.io/gh/Shopify/app-bridge/branch/master/graph/badge.svg?token=nZ21m39Dr6)](https:

15 lines (14 loc) 603 B
/** * @module util */ /** * Add an item to a collection, return a function that can then be used to * remove the item from the collection. Optionally accepting a callback that is * invoked when the item is removed from the collection. */ export declare function addAndRemoveFromCollection<T>(collection: T[], item: T, then?: Function): () => boolean; /** * Remove the item from the collection. Optionally accepting a callback that is * invoked when the item is removed from the collection. */ export declare function removeFromCollection<T>(collection: T[], item: T, then?: Function): boolean;