mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-18 12:08:59 +08:00
ramda: Add support for curry on view definition
This commit is contained in:
1
types/ramda/index.d.ts
vendored
1
types/ramda/index.d.ts
vendored
@@ -1728,6 +1728,7 @@ declare namespace R {
|
||||
* portion of the data structure is visible.
|
||||
*/
|
||||
view<T,U>(lens: Lens, obj: T): U;
|
||||
view<T,U>(lens: Lens): (obj: T) => U;
|
||||
|
||||
/**
|
||||
* Tests the final argument by passing it to the given predicate function. If the predicate is satisfied, the function
|
||||
|
||||
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user