Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Promises

Promise Helper

Hierarchy

  • Promises

Index

Methods

Static all

  • Parallel execute and returns when all plans be executed.
    并行执行所有计划

    Type parameters

    • T

    Parameters

    Returns Promise<T[]>

Static create

  • Returns a new Promise built-in an execution function.
    返回一个新Promise对象内置有执行函数

    Type parameters

    • T

    Parameters

    • fn: (this: PromiseContext<T>, ...args: any[]) => void

      the execution function

    • Rest ...args: any[]

      arguments of the execution function

    Returns Promise<T>

Static createPlan

  • Returns a PromisePlan.
    返回一个Promise计划

    Type parameters

    • T

    Parameters

    Returns PromisePlan<T>

Static newPlan

  • Returns a new PromisePlan based on an old PromisePlan.
    基于旧Promise计划,返回一个新Promise计划

    Type parameters

    • T

    Parameters

    • p: PromisePlan<T>

      an old PromisePlan

    • Optional args: any[]

      arguments of the new PromisePlan

    • Optional ctx: any

      context of the new PromisePlan

    Returns PromisePlan<T>

Static order

  • Execute all plans in sequential order.
    按顺序依次执行所有计划

    Type parameters

    • T

    Parameters

    Returns Promise<void>

Static race

  • Parallel execute and returns when any plan be executed.
    竞赛式执行计划

    Type parameters

    • T

    Parameters

    Returns Promise<any>

Static rejectPlan

  • Creates a new PromisePlan which returns a new rejected promise.
    返回一个新Promise计划,它将返回一个新的rejected promise

    Type parameters

    • T

    Parameters

    • v: any

      an argument need pass to the reject function of promise

    Returns PromisePlan<T>

Static resolvePlan

  • Creates a new PromisePlan which returns a new resolved promise.
    返回一个新Promise计划,它将返回一个新的resolved promise

    Type parameters

    • T

    Parameters

    • v: any

      an argument need pass to the resolve function of promise

    Returns PromisePlan<T>