Options
All
  • Public
  • Public/Protected
  • All
Menu

Module function/tap

Index

References

Functions

References

Renames and re-exports tap

Functions

  • tap<T>(fn: (a: T) => any, value: T): T
  • tap<T>(fn: (a: T) => any): (value: T) => T
  • Runs the given function with the supplied argument, then returns the argument.

    example
     var sayX = x => console.log('x is ' + x);
    tap(sayX, 100); //=> 100
    // logs 'x is 100'

    Type parameters

    • T

    Parameters

    • fn: (a: T) => any

      The function to call with x. The return value of fn will be thrown away.

        • (a: T): any
        • Parameters

          • a: T

          Returns any

    • value: T

    Returns T

    x.

  • Runs the given function with the supplied argument, then returns the argument.

    example
     var sayX = x => console.log('x is ' + x);
    tap(sayX, 100); //=> 100
    // logs 'x is 100'

    Type parameters

    • T

    Parameters

    • fn: (a: T) => any

      The function to call with x. The return value of fn will be thrown away.

        • (a: T): any
        • Parameters

          • a: T

          Returns any

    Returns (value: T) => T

    x.

      • (value: T): T
      • Parameters

        • value: T

        Returns T

Generated using TypeDoc