You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this repository, the discussions section is disabled. I believe my question should be located there.
I would like to see some API like this but maybe farfetched has a different approach to solving the same case.
import{createJsonQuery}from'@farfetched/core'import{runtypeContract}from'@farfetched/runtypes';import{Record,Literal}from'runtypes';constNotFoundUserResponse=Record({result: Literal(false),error: Record({type: Literal('USER_NOT_FOUND'),})});constSuccessUserResponse=Record({data: User,result: Literal(true)});constquery=createJsonQuery({// other options...contracts: {notFound: runtypeContract(NotFoundUserResponse),success: runtypeContract(SuccessUserResponse),}});sample({clock: query.finished.notFound,target: navigateUserToHomePageFx,});sample({clock: query.finished.success,// do something when everthing is ok});sample({clock: query.finished.unexpected,// do something when server response type is unexpected});
The text was updated successfully, but these errors were encountered:
In this repository, the discussions section is disabled. I believe my question should be located there.
I would like to see some API like this but maybe farfetched has a different approach to solving the same case.
The text was updated successfully, but these errors were encountered: