本文整理汇总了TypeScript中@phosphor/algorithm.ArrayExt.removeFirstOf方法的典型用法代码示例。如果您正苦于以下问题:TypeScript ArrayExt.removeFirstOf方法的具体用法?TypeScript ArrayExt.removeFirstOf怎么用?TypeScript ArrayExt.removeFirstOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@phosphor/algorithm.ArrayExt
的用法示例。
在下文中一共展示了ArrayExt.removeFirstOf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: _resolve
/**
* Resolve a button item.
*/
private _resolve(item: Dialog.IButton): void {
// Prevent loopback.
let promise = this._promise;
this._promise = null;
this.close();
ArrayExt.removeFirstOf(Private.launchQueue, promise.promise);
promise.resolve(item);
}
示例2: dispose
/**
* Dispose of the resources used by the dialog.
*/
dispose(): void {
const promise = this._promise;
if (promise) {
this._promise = null;
promise.reject(void 0);
ArrayExt.removeFirstOf(Private.launchQueue, promise.promise);
}
super.dispose();
}
示例3: dispose
/**
* Dispose of the resources used by the dialog.
*/
dispose(): void {
if (this._promise) {
let promise = this._promise;
this._promise = null;
promise.resolve(void 0);
ArrayExt.removeFirstOf(Private.launchQueue, promise.promise);
}
super.dispose();
}
示例4: _resolve
/**
* Resolve a button item.
*/
private _resolve(button: Dialog.IButton): void {
// Prevent loopback.
const promise = this._promise;
if (!promise) {
this.dispose();
return;
}
this._promise = null;
ArrayExt.removeFirstOf(Private.launchQueue, promise.promise);
let body = this._body;
let value: T | null = null;
if (button.accept && body instanceof Widget && typeof body.getValue === 'function') {
value = body.getValue();
}
this.dispose();
promise.resolve({ button, value });
}
示例5: it
it('should wrap around if stop < start', () => {
let data = ['one', 'two', 'three', 'four', 'one'];
let i = ArrayExt.removeFirstOf(data, 'two', 3, 1);
expect(i).to.equal(1);
expect(data).to.deep.equal(['one', 'three', 'four', 'one']);
});