Skip to content

prop

prop<S>(): <K>(key) => Lens<S, S[K]>

Defined in: Core/Lens.ts:55

Creates a Lens that focuses on a property of an object. Call with the structure type first, then the key.

S

<K>(key): Lens<S, S[K]>

K extends string | number | symbol

K

Lens<S, S[K]>

const nameLens = Lens.prop<User>()("name");