MCPcopy Create free account
hub / github.com/async-library/react-async / override

Function override

packages/react-async/src/useAsync.spec.js:207–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

205
206 test("calling `run` with a callback as argument allows to override fetch parameters", () => {
207 const override = params => ({ ...params, resource: "/bar", body: '{"name":"bar"}' })
208 const component = (
209 <Fetch input="/foo" init={{ method: "POST", body: '{"name":"foo"}' }}>
210 {({ run }) => <button onClick={() => run(override)}>run</button>}

Callers 1

useAsyncFetchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected