Add applyTo

This commit is contained in:
Jan van Brügge
2017-10-17 22:30:11 +02:00
committed by GitHub
parent 05ac46f9a9
commit 27fd582d60

View File

@@ -242,6 +242,13 @@ declare namespace R {
* the supplied arguments.
*/
applySpec<T>(obj: any): (...args: any[]) => T;
/**
* Takes a value and applies a function to it.
* This function is also known as the thrush combinator.
*/
applyTo<T, U>(el: T, fn: (t: T) => U): U;
applyTo<T>(el: T): <U>(fn: (t: T) => U) => U;
/**
* Makes an ascending comparator function out of a function that returns a value that can be compared with < and >.