developit / developit/workerize-loader

Typescript types?

Open
#3 16 comments 14 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
2.3k
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Its a bit difficult to write a definition file... any ideas how to handle that?

Would be easier if the export was the factory function that returns the exported functions:

```js
export default function worker() {
function expensive(time) {
let start = Date.now(), count = 0
while (Date.now() - start < time) count++
return count
}
return {expensive}
}
```

then the types would be identical if the functions return promises.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.