Task is just a promise, so you can just await it and use an if statement.
import*asTfrom'fp-ts/lib/Task'typeResp={code:number;description:string}declareconsttask:T.Task<Error|Resp>(async()=>{constresult=awaittask()if(resultinstanceofError){// Result is Error}else{// Result is Resp}})()
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.
Task is just a promise, so you can just
await
it and use an if statement.