Last active
August 18, 2019 14:51
-
-
Save rolandpeelen/a25b4c9d689085cc2e69b45d991cb36a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { lensPath, lensProp, compose } from 'ramda'; | |
| const objectsLens = lensPath(['scene', 'structure', 'objects']); | |
| const groupsLens = lensPath(['scene', 'structure', 'groups']); | |
| // If you use lenses all over the place, you may have some laying around allready, like these | |
| const sceneLens = lensProp('scene'); | |
| const structureLens = lensProp('structure'); | |
| const objectsLens = lensProp('objects'); | |
| const groupsLens = lensProp('groups'); | |
| // If so, we could make those top ones even easier | |
| const structureObjectLens = compose(sceneLens, structureLens, objectsLens); | |
| const structureGroupLens = compose(sceneLens, structureLens, groupsLens); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment