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

[docs/task] Consider adding note about typing args array with multiple types #1294

Closed
augustjk opened this issue Jan 13, 2024 · 1 comment
Closed

Comments

@augustjk
Copy link
Member

augustjk commented Jan 13, 2024

Consider this example
https://stackblitz.com/edit/vitejs-vite-bjrnbd?file=src%2Fmy-element.ts

The args function returns an array with 3 items of different types. Without adding as const, the inferred type of the args in the task function is an array where each item is a union of all possible values.

At the very least, we should include this for the TS code sample, and make a note of why it's needed. https://lit.dev/docs/data/task/#the-task-function

@augustjk
Copy link
Member Author

Fixed by #1329

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant