Exploring the use of pipe
and Option
in fp-ts
for my initial encounter.
I encountered this code snippet that performs type narrowing, but I believe it can be achieved without using the if
statement:
if (O.isNone(this.state)) {
return undefined;
}
return this.lens.get(this.state.value);