Could you explain your use of this.props.data.bimap?
this.props.data.bimap
I cannot find any reference to it in fp-ts docs and it throws the following compilation error.
fp-ts
TS2339: Property 'bimap' does not exist on type 'Either<Error | null, T>'. Property 'bimap' does not exist on type 'Left<Error | null>'.
Ok, I can see that the fp-ts api was changed during the 2.0 update.
bimap is now its own function and not a property of Either anymore.
bimap
Either
It seems the correct implementation is now:
export class Remote<T> extends React.Component<RemoteProps<T>, RemoteState> { public render() { return ( <React.Fragment> { pipe(this.props.data, fold( l => { if (l === null) { return this.props.loading(); } else { return this.props.error(l); } }, r => { return this.props.success(r); })) } </React.Fragment> ); } }
@remojansen do you agree with this implementation?
gracias!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Could you explain your use of
this.props.data.bimap
?I cannot find any reference to it in
fp-ts
docs and it throws the following compilation error.TS2339: Property 'bimap' does not exist on type 'Either<Error | null, T>'. Property 'bimap' does not exist on type 'Left<Error | null>'.
Ok, I can see that the fp-ts api was changed during the 2.0 update.
bimap
is now its own function and not a property ofEither
anymore.It seems the correct implementation is now:
@remojansen do you agree with this implementation?
gracias!