-
Notifications
You must be signed in to change notification settings - Fork 186
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
Add a destroy method #11
Conversation
@yoannmoinet if you are aware of other things I should consider for |
Hi, very good idea 😎👍. I'd add a few steps though. We should also check if the manager has alive joysticks in its You're calling Tell me what you think about those. Finally, can you also update the README to sync with these features please ?
Remember to follow the commit standards in place, otherwise we won't see your feature in the generated CHANGELOG : Thank you very much for your contribution, it's really appreciated ! |
Great! I'll work on this lately. About the |
true. But we're going without a net here... no dependency ! |
Ok I found some time to update this PR. I still have some concerns:
|
Good stuff... nothing much to say about it 👍 except this comment.
Good point. We might want to trigger an event
Very true, better safe than sorry, I would remove all events from there. |
Thank you for the review, will update as soon as possible |
|
||
// Remove destroyed nipple from the list | ||
Manager.prototype.ondestroyed = function(evt, nipple) { | ||
nipple = this.nipples.get(nipple.identifier); |
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.
One issue here, and might be the case for all events: the nipple instance passing along is not the same instance in nipples
manager list. Got to get the manager side instance by identifier
. This comes from Nipple#constructor
returning a custom object.
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.
This is very weird.
Can you add a comment to explain it above the line nipple = this.nipples.get[...]
to act as a reminder for me, please.
Can you also log an issue about this with the info you've collected please?
I'll look at this later on. This is not a blocker for your PR, if your patch is working correctly.
After your comment, I'll be able to merge it.
👍 Good job and thank you very much for your help !
I'm merging this. I'll add the comment about mis-linked nipple instances. |
Hey hi, thank you for the merge and sorry not being around, very very busy those days. |
no worries. I've merge because I've also found why instances weren't the same when destroying nipples. In fact, we're not returning an instance from the Anyway, thank you so much for your help. |
Created manager never unbind for events and do not expose unbind. This PR aims to fix this.
A public destroy method is a good way to let user create then clearing a view (I think about view as a Backbone.Marionette user, but it's the same for React, Ember, ...), then go back, re-create, etc, safely, without memory leak or issues due to events.
Related to #6