Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "utils/papply-right/docs/types/index.d"

Index

Type aliases

Functions

Type aliases

Closure

Closure: (...args: Array<any>) => any

Partially applied function.

param

function arguments

returns

partially applied function result

Type declaration

    • (...args: Array<any>): any
    • Parameters

      • Rest ...args: Array<any>

      Returns any

Functions

Export assignment papplyRight

  • papplyRight(fcn: Function, ...args: Array<any>): Closure
  • Returns a function of smaller arity by partially applying arguments from the right.

    Parameters

    • fcn: Function

      function to partially apply

    • Rest ...args: Array<any>

      arguments to partially apply

    Returns Closure

    partially applied function

    Example

    function say( text, name ) {
        return text + ', ' + name + '.';
    }
    
    var toGrace = papplyRight( say, 'Grace Hopper' );
    
    var str = toGrace( 'Hello' );
    // returns 'Hello, Grace Hopper.'
    
    str = toGrace( 'Thank you' );
    // returns 'Thank you, Grace Hopper.'