Skip to main content

lensProp()

lensProp<T>(): <K>(prop) => Lens<T, T[K]>

Short-hand to create a simplistic get/set lens.

Type Parameters

T

T extends object

The type of the object being inspected.

Returns

<K>(prop): Lens<T, T[K]>

Type Parameters

K

K extends string | number | symbol

Parameters

prop

K

Returns

Lens<T, T[K]>

Remarks

pure function

Example

const { get, set } = lensProp<Person>()('name');