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
I was wondering whether it would be possible to make a variant API that allows you to essentially leave the initial match constructor empty and to evaluate left-hand patterns. Like a more succinct case/switch:
constgetActionType=(doc: DocumentApi)=>match<Boolean,ActionType>(doc).with(isMutationAction,()=>"Mutation").with(isQueryAction,()=>"Query").otherwise(()=>newError("Neither Mutation or Query found in Document SDL")).run()asActionType
Because currently, I am doing it like this, which feels a bit awkward:
constgetActionType=(doc: DocumentApi)=>match<Boolean,ActionType>(isMutationAction(doc)).with(true,()=>"Mutation").with(false,()=>"Query").otherwise(()=>newError("Neither Mutation or Query found in Document SDL")).run()asActionType
Thank you for such a wonderful library =D
The text was updated successfully, but these errors were encountered:
I was wondering whether it would be possible to make a variant API that allows you to essentially leave the initial match constructor empty and to evaluate left-hand patterns. Like a more succinct case/switch:
Because currently, I am doing it like this, which feels a bit awkward:
Thank you for such a wonderful library =D
The text was updated successfully, but these errors were encountered: