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

Setup event callbacks before init #1131

Merged
merged 1 commit into from
May 20, 2017
Merged

Conversation

mucaho
Copy link
Contributor

@mucaho mucaho commented May 17, 2017

Setup event callbacks defined in the events object before calling
the init method in component and system definition.
This allows triggering bound callbacks in the init method.

see #1126

Setup event callbacks defined in the events object before calling
the init method in component and system definition.
This allows triggering bound callbacks in the init method.
@starwed
Copy link
Member

starwed commented May 20, 2017

I guess the big question is, are there any common use cases where you want to bind events after the init function?

I can't really think of any, and I think binding events before running init is the least surprising order. You can always explicitly bind events at the end of init if that's what you really want.

@mucaho
Copy link
Contributor Author

mucaho commented May 20, 2017

You can always explicitly bind events at the end of init if that's what you really want.

Good point, workaround is available if needed.

@mucaho mucaho merged commit bd287ef into craftyjs:develop May 20, 2017
@mucaho mucaho deleted the init-order branch May 20, 2017 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants