Open mrjackdavis opened 2 weeks ago
optic-ts contains a standalone api which looks a bit more like this
O.compose( 'foo', O.optional, O.when((value: number) => value > 42) )
I've come across instances where this API is preferable, especially if I'm reusing complex optics
e.g.
const myComplexOptic = O.compose( 'foo', O.optional, O.guard((obj:{type:string}) => obj.type === 'bar') ) const bazAtom = focusAtom(dataAtom,O.compose(myComplexOptic,'baz')); const quxAtom = focusAtom(dataAtom,O.compose(myComplexOptic,'qux'));
This might also contribute to solving such issues as #15 without introducing new concepts
I think this would be worth implementing
Would you be interested in implementing it? I think we should create a completely new function.
optic-ts contains a standalone api which looks a bit more like this
I've come across instances where this API is preferable, especially if I'm reusing complex optics
e.g.
This might also contribute to solving such issues as #15 without introducing new concepts
I think this would be worth implementing