Class Promise

Index

Constructor methods

Methods

Constructor methods

constructor(fn?: (err: any, result: T) => void): Promise

Parameters

  • fn?: (err: any, result: T) => void optional

Returns

Promise

Methods

public addBack(listener: (err: any, result: T) => void): Promise

Parameters

  • listener: (err: any, result: T) => void

Returns

Promise

public addCallback(listener: (result: T) => void): Promise

Parameters

  • listener: (result: T) => void

Returns

Promise

public addErrback(listener: (err: any) => void): Promise

Parameters

  • listener: (err: any) => void

Returns

Promise

public complete(result: T in "mongoose".Promise<T>): Promise

Parameters

  • result: T in "mongoose".Promise<T>

Returns

Promise

public end()

public error(err: any): Promise

Parameters

  • err: any

Returns

Promise

public fulfill(result: T in "mongoose".Promise<T>): Promise

Parameters

  • result: T in "mongoose".Promise<T>

Returns

Promise

public on(event: string, listener: Function): Promise

Parameters

  • event: string
  • listener: Function

Returns

Promise

public onFulfill(listener: (result: T) => void): Promise

Parameters

  • listener: (result: T) => void

Returns

Promise

public onReject(listener: (err: any) => void): Promise

Parameters

  • listener: (err: any) => void

Returns

Promise

public onResolve(listener: (err: any, result: T) => void): Promise

Parameters

  • listener: (err: any, result: T) => void

Returns

Promise

public reject(err: any): Promise

Parameters

  • err: any

Returns

Promise

public resolve(err: any, result: T in "mongoose".Promise<T>): Promise

Parameters

  • err: any
  • result: T in "mongoose".Promise<T>

Returns

Promise

public then(onFulFill: (result: T) => void, onReject?: (err: any) => void): Promise

Parameters

  • onFulFill: (result: T) => void
  • onReject?: (err: any) => void optional

Returns

Promise