flekschas / regl-scatterplot

Scalable WebGL-based scatter plot library build with Regl
https://flekschas.github.io/regl-scatterplot/
MIT License
194 stars 24 forks source link

fix: fixed pubsub related types #176

Closed funmaker closed 5 months ago

funmaker commented 6 months ago

Write one to two sentences summarizing this PR

Current pubsub types do not match actual types used by pub-sub-es. This PR fixes them.

What was changed in this pull request?

Added missing return value in subscribe and added missing argument/overload for unsubscribe. Also added helper types for subscription object and handler.

Why is it necessary?

Because you can't use unsubscribe properly from events right now.

Checklist

flekschas commented 6 months ago

Wow thanks for putting this together! I'm happy to merge this. One thing I wonder though is if we can actually remove the pub-sub typing here altogether as I recently added types to the pub-sub-es library. I know that @manzt added the pub-sub types here before pub-sub-es was typed but I think it might be better to fix any type issues in the pub-sub library instead of here.

I know this means more work but would you be willing to see if removing the pub-sub types here fixes the issue? I'm also happy to merge this fix for now and properly refactor things later.

flekschas commented 5 months ago

I'm closing this PR as I've refactored pub-sub-es to TypeScript to fix all the typing issues once and for all. Please let me know if you still run into issues with v1.9.0.