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

Merge create method into constructor #375

Merged
merged 2 commits into from
Jul 1, 2022

Conversation

mxmason
Copy link
Contributor

@mxmason mxmason commented Jul 1, 2022

Summary

As it says on the tin. Also gets rid of a Targets type that is only referenced for create and wasn't being used by create anyway.

Step two of work discussed in #373

export type EventHandler = (node: Element, event?: Event) => void;
export type EventType = "show" | "hide" | "destroy" | "create";

export class A11yDialog {
constructor(node: Element, targets?: Targets);

create(targets: Targets): A11yDialog;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this was wrong. targets no longer exists since v7.

@@ -64,8 +55,6 @@ A11yDialog.prototype.create = function () {

// Execute all callbacks registered for the `create` event
this._fire('create')

return this
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is implied, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, return this is implicit when we do a new operation, whether for this syntax or for proper es6 classes.

@KittyGiraudel KittyGiraudel merged commit c00bfb1 into KittyGiraudel:main Jul 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants