Kaynağa Gözat

Renames `Promise.isPromise` to `is`

main
Eric Amodio 5 yıl önce
ebeveyn
işleme
8f2c4638cb
5 değiştirilmiş dosya ile 5 ekleme ve 5 silme
  1. +1
    -1
      src/system/decorators/gate.ts
  2. +1
    -1
      src/system/decorators/log.ts
  3. +1
    -1
      src/system/promise.ts
  4. +1
    -1
      src/views/nodes/compareNode.ts
  5. +1
    -1
      src/views/nodes/searchNode.ts

+ 1
- 1
src/system/decorators/gate.ts Dosyayı Görüntüle

@ -47,7 +47,7 @@ export function gate any>(resolver?: (...args: Parame
let promise = this[prop];
if (promise === undefined) {
const result = fn!.apply(this, args);
if (result == null || !Promises.isPromise(result)) {
if (result == null || !Promises.is(result)) {
return result;
}

+ 1
- 1
src/system/decorators/log.ts Dosyayı Görüntüle

@ -288,7 +288,7 @@ export function log any>(
}
};
if (result != null && Promises.isPromise(result)) {
if (result != null && Promises.is(result)) {
const promise = result.then(logResult);
promise.catch(logError);
}

+ 1
- 1
src/system/promise.ts Dosyayı Görüntüle

@ -10,7 +10,7 @@ export namespace Promises {
});
}
export function isPromise<T>(obj: T | Promise<T>): obj is Promise<T> {
export function is<T>(obj: T | Promise<T>): obj is Promise<T> {
return obj && typeof (obj as Promise<T>).then === 'function';
}

+ 1
- 1
src/views/nodes/compareNode.ts Dosyayı Görüntüle

@ -120,7 +120,7 @@ export class CompareNode extends ViewNode {
const promises: Promise<any>[] = [
...Iterables.filterMap(this._children, c => {
const result = c.refresh === undefined ? false : c.refresh();
return Promises.isPromise<boolean | void>(result) ? result : undefined;
return Promises.is<boolean | void>(result) ? result : undefined;
})
];
await Promise.all(promises);

+ 1
- 1
src/views/nodes/searchNode.ts Dosyayı Görüntüle

@ -139,7 +139,7 @@ export class SearchNode extends ViewNode {
const promises: Promise<any>[] = [
...Iterables.filterMap(this._children, c => {
const result = c.refresh === undefined ? false : c.refresh();
return Promises.isPromise<boolean | void>(result) ? result : undefined;
return Promises.is<boolean | void>(result) ? result : undefined;
})
];
await Promise.all(promises);

Yükleniyor…
İptal
Kaydet