Class: Compose

Compose

new Compose(lensA, lensB) → {Compose}

Create the composite of two Lenses. For instance, to create a Lens for arr[i][j]:

arrIJLens = new Compose(
    new IndexedLens(1),
    new IndexedLens(0)
);

Then arrIJLens.get, .set, and .map first call the appropriate function for the first Lens, then the appropriate function for the second Lens and return the result.

Parameters:
Name Type Description
lensA Lens

The first Lens to call functions on

lensB Lens

The second Lens to call functions on

Returns:
Type
Compose