本文整理汇总了TypeScript中@phosphor/algorithm.ArrayExt.removeAllWhere方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ArrayExt.removeAllWhere方法的具体用法?TypeScript ArrayExt.removeAllWhere怎么用?TypeScript ArrayExt.removeAllWhere使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@phosphor/algorithm.ArrayExt
的用法示例。
在下文中一共展示了ArrayExt.removeAllWhere方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: cleanupConnections
/**
* Cleanup the dirty connections in a connections array.
*
* This will remove any connection with a `null` signal.
*
* This function should only be invoked asynchronously, when the
* stack frame is guaranteed to not be on the path of user code.
*/
function cleanupConnections(connections: IConnection[]): void {
ArrayExt.removeAllWhere(connections, isDeadConnection);
}
示例2: it
it('should support a negative stop index', () => {
let data = [1, 2, 3, 4, 3, 5, 1];
let count = ArrayExt.removeAllWhere(data, v => v % 3 === 0, 3, -2);
expect(count).to.equal(1);
expect(data).to.deep.equal([1, 2, 3, 4, 5, 1]);
});
示例3: cleanupHooks
/**
* Cleanup the dirty hooks in a message hooks array.
*
* This will remove any `null` hook from the array.
*
* This function should only be invoked asynchronously, when the
* stack frame is guaranteed to not be on the path of user code.
*/
function cleanupHooks(hooks: Array<MessageHook | null>): void {
ArrayExt.removeAllWhere(hooks, isNull);
}