Class: Getter

Getter

new Getter(get, options) → {Getter}

A Getter is a Lens that doesn't support setting or mapping over values. A Getter is constructed using only a get function, which returns the element (or elements) the Lens should view on.

Parameters:
Name Type Description
get function

Function to allow access to an object via this lens.

options object

Additional flags to set in the resulting Lens

Returns:
Type
Getter

Methods

<static> fromLens(lens)

Construct a Getter from a Lens by overwriting its map and set functions.

Parameters:
Name Type Description
lens Lens

The Lens to convert to a Getter.