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
Getterfrom aLensby overwriting its map and set functions.Parameters:
Name Type Description lensLens The
Lensto convert to aGetter.