Options
All
  • Public
  • Public/Protected
  • All
Menu

Module promise/resolveWith

Index

References

Functions

References

Renames and re-exports resolveWith

Functions

  • resolveWith<T1, T2, R>(func: (a: T1, b: T2, ...args: any[]) => R, a: T1, b: T2, ...args: any[]): Promise<R>
  • resolveWith<T, R>(func: (a: T) => R, a: T): Promise<R>
  • resolveWith<T1, T2, R>(func: (a: T1, b: T2, ...payload: any[]) => R): (a: T1, b: T2, ...payload: any[]) => Promise<R>
  • resolveWith<T, R>(func: (a: T) => R): (a: T) => Promise<R>
  • resolveWith<R>(func: Func<R>): (...payload: any[]) => Promise<R>
  • Returns a promise that resolves with a value returned by the supplied function when passed the supplied payload

    example
     rejectWith(toLowerCase, 'OK').then( res => console.info(res) );//=> 'ok'
    

    Type parameters

    • T1

    • T2

    • R

    Parameters

    • func: (a: T1, b: T2, ...args: any[]) => R
        • (a: T1, b: T2, ...args: any[]): R
        • Parameters

          • a: T1
          • b: T2
          • Rest ...args: any[]

          Returns R

    • a: T1
    • b: T2
    • Rest ...args: any[]

    Returns Promise<R>

  • Returns a promise that resolves with a value returned by the supplied function when passed the supplied payload

    example
     rejectWith(toLowerCase, 'OK').then( res => console.info(res) );//=> 'ok'
    

    Type parameters

    • T

    • R

    Parameters

    • func: (a: T) => R
        • (a: T): R
        • Parameters

          • a: T

          Returns R

    • a: T

    Returns Promise<R>

  • Returns a promise that resolves with a value returned by the supplied function when passed the supplied payload

    example
     rejectWith(toLowerCase, 'OK').then( res => console.info(res) );//=> 'ok'
    

    Type parameters

    • T1

    • T2

    • R

    Parameters

    • func: (a: T1, b: T2, ...payload: any[]) => R
        • (a: T1, b: T2, ...payload: any[]): R
        • Parameters

          • a: T1
          • b: T2
          • Rest ...payload: any[]

          Returns R

    Returns (a: T1, b: T2, ...payload: any[]) => Promise<R>

      • (a: T1, b: T2, ...payload: any[]): Promise<R>
      • Parameters

        • a: T1
        • b: T2
        • Rest ...payload: any[]

        Returns Promise<R>

  • Returns a promise that resolves with a value returned by the supplied function when passed the supplied payload

    example
     rejectWith(toLowerCase, 'OK').then( res => console.info(res) );//=> 'ok'
    

    Type parameters

    • T

    • R

    Parameters

    • func: (a: T) => R
        • (a: T): R
        • Parameters

          • a: T

          Returns R

    Returns (a: T) => Promise<R>

      • (a: T): Promise<R>
      • Parameters

        • a: T

        Returns Promise<R>

  • Returns a promise that resolves with a value returned by the supplied function when passed the supplied payload

    example
     rejectWith(toLowerCase, 'OK').then( res => console.info(res) );//=> 'ok'
    

    Type parameters

    • R

    Parameters

    Returns (...payload: any[]) => Promise<R>

      • (...payload: any[]): Promise<R>
      • Parameters

        • Rest ...payload: any[]

        Returns Promise<R>

Generated using TypeDoc