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

Required times property for subscribe event #117

Closed
insertmike opened this issue Apr 13, 2023 · 3 comments
Closed

Required times property for subscribe event #117

insertmike opened this issue Apr 13, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@insertmike
Copy link
Contributor

Why is the times property required? Assuming it is used to specify the number of times the eventHandler function should be called when a specified event occurs, why enforcing this?

Typescript complaining if not passed:

  scatter.subscribe<"select">("select", (event: EventMap["select"]) => {
     ...
  });

Error:

Expected 3 arguments, but got 2.ts(2554)
regl-scatterplot.esm.d.ts(73, 361): An argument for 'times' was not provided

In fact, where is this used, I can't find a reference for times in the repository, except at PubSubEvent definition. Is it retrieved somewhere dynamically from arg length?

times: number

@flekschas
Copy link
Owner

This is just a typing issue. The property is coming from https://github.com/flekschas/pub-sub and is not required. By default it's set to Infinity. I'll update the type in the next release, thanks for bringing this up.

@flekschas flekschas added the bug Something isn't working label Apr 13, 2023
@flekschas
Copy link
Owner

Just released v1.6.5 which should fix the type issue

@insertmike
Copy link
Contributor Author

Fixed in v1.6.5 💯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants