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

Lifecycle methods #31

Closed
wants to merge 6 commits into from
Closed

Conversation

Madumo
Copy link

@Madumo Madumo commented Sep 8, 2016

Like we talked on issue #27, there is no real lifecycle hooks right now. I just added some:

  • beforeRender
  • afterRender
  • beforeUpdate
  • afterUpdate
  • beforeRemove
  • afterRemove

beforeUpdate and afterUpdate are both called with the update data.

@antonmedv
Copy link
Owner

Like this, but what is impact on perf? Calling a lot of noop? Also we need docs for this stuff.

@Madumo
Copy link
Author

Madumo commented Sep 9, 2016

For the noop, the jit normally see that the function call does nothing and remove it. It is actually faster than if (thereIsAFunction) { callFunction(); }. In fact, some other parts of monkberry could also benefit from this, but that was not the point of the PR.

source (see part 3)

@Madumo
Copy link
Author

Madumo commented Sep 9, 2016

I just found out that this build sometime throw the Can not insert child view into parent node. You need append your view first and then update. error when inserting a comment node. I will look into that and come back with a fix and proper documentation.

@antonmedv
Copy link
Owner

Okay.

@Madumo
Copy link
Author

Madumo commented Sep 9, 2016

Oh nevermind about the error, it was because of something else in my app, not because of that patch.

@antonmedv
Copy link
Owner

@Madumo sorry for delay) Now I'm working on v5 with full lifecycle events (see next branch)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants