Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generic Piscina class to typecheck run() parameters and return type. #231

Closed
arthurfiorette opened this issue May 23, 2022 · 2 comments · Fixed by #569
Closed

Use generic Piscina class to typecheck run() parameters and return type. #231

arthurfiorette opened this issue May 23, 2022 · 2 comments · Fixed by #569
Labels
good first issue Good for newcomers stale typescript TypeScript Related Issues/PRs

Comments

@arthurfiorette
Copy link

Changing the Piscina class to use a generic T (parameter) and R (possible return). This way it would be possible to get a better developer experience and intellisense while using this package.

Example:

declare class Piscina<T = any, R = any> ... {
  ...

  run(task: T, options?: RunOptions): Promise<R>;
}

I'm also open to create a PR...

Thanks!

@metcoder95
Copy link
Member

PR is welcome 🙂

@metcoder95 metcoder95 added the typescript TypeScript Related Issues/PRs label Jun 12, 2023
@metcoder95 metcoder95 added the good first issue Good for newcomers label Nov 22, 2023
Copy link

This issue has been marked as stale because it has been opened 30 days without activity. Remove stale label or comment or this will be closed in 5 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers stale typescript TypeScript Related Issues/PRs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants