gcanti / monocle-ts

Functional optics: a (partial) porting of Scala monocle
https://gcanti.github.io/monocle-ts/
MIT License
1.05k stars 52 forks source link

Lens set #165

Open steida opened 3 years ago

steida commented 3 years ago

Lens set as modify without a callback.

case 'reinitialize':
  return pipe(
    state,
    pipe(
      lens.id<typeof state>(),
      lens.prop('reinitialize'),
      // lens.set(true),
      lens.modify(() => true),
    ),
  );
steida commented 3 years ago

Also, lens.from(state) would be handy. Or am I doing it wrong?