Example in README cannot be compiled in TypeScript
- Dominant language
- JavaScript
- Stars
- 3.4k
- Forks
- 137
- PR merge metrics
- No merged PRs in 30d
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.
```typescript
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;
});
```
I fixed it like the following it can be compiled.
```typescript
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;
});
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.