Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 19 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import { lensPath, pipe } from 'ramda' |
||
2 | |||
3 | /** |
||
4 | * Lens for zooming in the global state. |
||
5 | * @function |
||
6 | */ |
||
7 | const globalStateLens = lensPath(['store', 'state']) |
||
8 | |||
9 | /** |
||
10 | * Create a new lens based on the given lens and globalStateLens. |
||
11 | * @function |
||
12 | * @param {function} lens - The lens to zoom into the global state |
||
13 | * @return {function} Composed lens |
||
14 | */ |
||
15 | export const inGlobalStateLens = lens => |
||
16 | pipe( |
||
17 | lens, |
||
18 | globalStateLens |
||
19 | ) |
||
20 |