Typescript error on event invocation with argument
See original GitHub issueAfter the last update with the improved types, I now get an error whenever I invoke an event with an argument.
state.paginate(page);
Error: Expected 0 arguments, but got 1. (ts)
state.paginate(page);
Thanks a lot for this library, really useful!
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
TypeScript union types - error only on function invocation
The handler function assumes that a non-boolean non-object parameter must be a string, but SomeFunction calls _props.onChange() with a number.
Read more >EventTarget.removeEventListener's second argument is ...
TypeScript Version: 2.2.0 Code // this throws at runtime due to the missing second argument, // but it typechecks as the second argument...
Read more >Documentation - Do's and Don'ts
Optional Parameters in Callbacks This has a very specific meaning: the done callback might be invoked with 1 argument or might be invoked...
Read more >Functions - TypeScript: Handbook
Functions are the fundamental building block of any application in JavaScript. They're how you build up layers of abstraction, mimicking classes, ...
Read more >Documentation - TypeScript 3.7
Uncalled Function Checks. A common and dangerous error is to forget to invoke a function, especially if the function has zero arguments or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@kenkunz @ivanhofer Works great! Thanks so much for the quick work, really appreciate it.
Just so you know, my agency switched to Sveltekit and we’re going to be using
svelte-fsm
in production for some of our components!Wow that was fast! Thanks a lot.
@ivanhofer I tried that already but my configuration still won’t allow it (and I can’t really change it). In any case, this is easy to work around, I just thought it should be addressed since it’s a core part of the API.