Skip to content

Conversation

@federicodionisi
Copy link

Hi! I've updated the mixin to the newest NuclearJS and added few more things like a $bind and $unbind function and a parameter in the mixin's initialization function for make the component sleep if not attached.

The time machine restoring part in the example is not finished because of loadStore methods and this optimizely/nuclear-js#24

@jordangarcia
Copy link
Owner

Hey @federicodionisi thanks a lot for PRing this.

Can you explain more the idea behind using isLazy and usages of $bind

@federicodionisi
Copy link
Author

The purpose is to avoid unnecessary calculation of Vue's computed values when a component is detached and handles/manipulate data only when attached.

@jordangarcia
Copy link
Owner

What is a case where a component would be detached and not destroyed?

It seems like extra computational cost to unbind / rebind nuclear data to a component on attach / detach than to only bind it when attached and unbind when destroyed.

@federicodionisi
Copy link
Author

Sorry my delay.
An example could be a component with keep-alive on it.

I have also my specific case where I want to keep in sync multiple device through web socket, transforming big amount of data rendered in charts and tables, and I prefer to avoid to re-create all components each time.

But, if you think that will be useless for the most, I can update the PR to not include isLazy and $bind, $unbind

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