Effect with Remix for Reusable Hooks

so after watching our effectful lord and saviour on his inaugural live twitch demonstration of leveraging effect with remix, it gave me that aha moment about how best to make a completely reusable set of hooks that allow for effectful queries and mutations while maintaing an almost 1 to 1 api with tanstacks respective useQuery and useMutation hooks, save that the query and mutation arguments accept only effects that also meet the requirements of the abstracted away runtime. complete typesafety from top to bottom - with error channels also inferred from the output. no need to use a runtime, it was created and returned from the same factory function so the effects are resolved internally.
image.png
Was this page helpful?