From cd4d27c57d53b3e3ab69d61c10eba5cd75e9acfa Mon Sep 17 00:00:00 2001 From: "Michael R. Maletich" Date: Thu, 18 May 2017 12:21:13 -0500 Subject: [PATCH] ramda: Add support for curry on view definition --- types/ramda/index.d.ts | 1 + types/ramda/ramda-tests.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/ramda/index.d.ts b/types/ramda/index.d.ts index 7fde62feee..d74b8b3e14 100644 --- a/types/ramda/index.d.ts +++ b/types/ramda/index.d.ts @@ -1728,6 +1728,7 @@ declare namespace R { * portion of the data structure is visible. */ view(lens: Lens, obj: T): U; + view(lens: Lens): (obj: T) => U; /** * Tests the final argument by passing it to the given predicate function. If the predicate is satisfied, the function diff --git a/types/ramda/ramda-tests.ts b/types/ramda/ramda-tests.ts index 5c5948b047..9afa47ba04 100644 --- a/types/ramda/ramda-tests.ts +++ b/types/ramda/ramda-tests.ts @@ -1161,6 +1161,7 @@ class Rectangle { () => { var xLens = R.lens(R.prop('x'), R.assoc('x')); R.view(xLens, {x: 1, y: 2}); //=> 1 + R.view(xLens)({x: 1, y: 2}); //=> 1 R.set(xLens, 4, {x: 1, y: 2}); //=> {x: 4, y: 2} R.set(xLens)(4, {x: 1, y: 2}); //=> {x: 4, y: 2} R.set(xLens, 4)({x: 1, y: 2}); //=> {x: 4, y: 2}