本文整理匯總了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']);
});