Open
Description
Hi, I tried to compile the following example in 4.0.0-0
in TypeScript, which is in README, but I couldn't compile it.
import { connect, PromiseState } from "react-refetch";
interface Props {
fooFetch: PromiseState<{}>;
barFetch: PromiseState<{}>;
}
export default connect<{}, Props>(() => ({
fooFetch: {
url: `/foos/1`,
andThen: foo => ({
barFetch: `/bar-for-foos-by-id/1`
})
}
}))(() => {
return <a>a</a>;
});
I fixed it like the following it can be compiled.
import { connect, PromiseState } from "react-refetch";
interface Props {
fooFetch: PromiseState<{}>;
barFetch: PromiseState<{}>;
}
export default connect<{}, Props>(() => ({
fooFetch: {
url: `/foos/1`,
andThen: foo => ({
fooFetch: { value: foo },
barFetch: `/bar-for-foos-by-id/1`
})
},
barFetch: { value: null }
}))(() => {
return <a>a</a>;
});
Metadata
Metadata
Assignees
Labels
No labels