Closed martinmckenna closed 9 months ago
Allows consuming code to pass a type argument for the return value of createMutatorStore. Really, it just re-uses the Response argument and passes it through to MutatorCb
createMutatorStore
Response
MutatorCb
const doThing = async (): Promise<{id: string}> => { const r = await fetch("/hello/world"); return r.json(); }; const $createThing = createMutatorStore< { hello: "world" }, { id: string; description: string } >(() => doThing()); // will correctly error b/c doThing() is missing `description`
@martinmckenna Thanks! Published in 0.2.10.
Description
Allows consuming code to pass a type argument for the return value of
createMutatorStore
. Really, it just re-uses theResponse
argument and passes it through toMutatorCb
Usage