(no title)
shiny | 5 years ago
Looks like I need to incorporate encoders/decoders into my scheme. I might just steal that code outright.
Thanks for the Zapatos rec, that looks perfect.
fyi, my current generic method sigs looks like:
export const makeRequest = <Name extends keyof Endpoints>(
_name: Name,
method: Endpoints[Name]['method'],
path: Endpoints[Name]['path'],
props: {
data: Endpoints[Name]['clientSends'];
onSuccess: (json: Endpoints[Name]['serverResponds']) => void;
onError: (json: any) => void;
}
) => { // ...
Dropping all of these typing shenanigans and going back to Elixir/Phoenix is always half-tempting, but I will soldier on for now...
eyelidlessness|5 years ago