backbone.marionette icon indicating copy to clipboard operation
backbone.marionette copied to clipboard

remove:region events are not triggered if a view's region is destroyed

Open paulfalgout opened this issue 6 years ago • 3 comments

Currently in v4 if a region is destroyed the view the region belongs to will not trigger the remove:region event. They are only triggered if view.removeRegion(name) is used. All that method does is trigger the events and destroy the region.

It seems minor, but inconsistent.

Seems like _removeReferences and the remove events could be triggered off of the region's destroy event. Of course that means adding a listener for each region instance which is less than ideal.

paulfalgout avatar May 10 '18 06:05 paulfalgout

Wondering if there any real use case for remove:region, add:region events.

When i looked at it i could not think of an actual usage scenario

blikblum avatar May 10 '18 12:05 blikblum

I tend to agree. I can't come up with any scenario. Worth looking to maybe deprecate them and remove them for v5. I was mainly making this issue to document the inconsistency

paulfalgout avatar May 10 '18 12:05 paulfalgout

Went back in history and it looks like this event was primarily internal and was for the region manager to talk with the view or app. Probably safe to deprecate it.

paulfalgout avatar May 10 '18 12:05 paulfalgout