[Help] Function that returns a polymorphic instance of a Class
Open
- Dominant language
- Rust
- Stars
- 22.3k
- Forks
- 1.9k
- PR merge metrics
- No merged PRs in 30d
Description
So I have a class `DataLoader` - you may have recognized the [dataloader module](https://github.com/facebook/dataloader).
I have a function that returns a new DataLoader with default options.
```
const myFn = (batchLoadFn) => new DataLoader(batchLoadFn, { cache: false });
```
I tried to type it as
```
const myFn/*: (fn: any) => Dataloader */ = ... ;
```
But it won't work. Any idea on how to achieve the right typing?
Contributor guide
Assessment
This issue has not been assessed yet.