improve typing by making arguments generic
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Current type:
```typescript
Limit.throttledUpdate(fn: Function, wait: number): (...args: any[]) => void
```
The problem is that when you make a function with it, like so:
```typescript
let throttledFunc = new Limit().throttledUpdate((x:string,y:number)=>"foo", 50)
```
The throttledFunc has type (...args: any[]) => void
But it should have type (x:string, y:number) => void
Ideally I would want to do something like this:
```typescript
Limit.throttledUpdate(fn: ...T, wait: number): (...T) => void
```
Unfortunately, it looks like this capability is still in the proposal stages: https://github.com/Microsoft/TypeScript/issues/5453
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.