-
Notifications
You must be signed in to change notification settings - Fork 69
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
Adds JSDoc support for EventManager #327
base: master
Are you sure you want to change the base?
Adds JSDoc support for EventManager #327
Conversation
✅ Deploy Preview for electrodb-dev canceled.
|
package-lock.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a version mismatch when installing.
/** | ||
* @type {Array<ElectroEventListener>} | ||
* */ | ||
#listeners; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the class to use private properties
// no-op | ||
return () => {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not get the filter to understand that undefined would have been removed even with type guards, so changed it to a no-op and removed the filter entirely.
Adds typechecking to Event Manager - Updates package-lock version mismatch - Fixes tests that broke after tsconfig change - Adds comment for ts error - Refactors types for simpler testing - Updates tests and types
58f4167
to
95a8acf
Compare
This is week is crazy for me, I hope to review this over the weekend 👍 |
This PR enables typechecking for JS and the Event Manager class.
Since the project is mostly written in javascript, I thought it would be suitable to start to add gradual types to the codebase. I've only started with the Event Manager class for you to get a feel of what it might look like and the DX around it.