Open
requested to merge github/fork/alpadev/alpadev/call-dispose-on-component-reinstantiation into main
Created by: alpadev
Description
Call dispose()
automatically when a component is initialized on an element that has already another component (of the same type) stored in the registry.
Note: Looks like there is an issue with this approach. At the moment this change seem to cause tests to be flaky at times. I ran them several times with some randomly failing and sometimes not.
Motivation & Context
It solves the problem of components being (re)initialized multiple times, without calling dispose()
manually on the existing instance.
Type of changes
-
Bug fix (non-breaking change which fixes an issue) -
New feature (non-breaking change which adds functionality) -
Refactoring (non-breaking change) -
Breaking change (fix or feature that would change existing functionality)
Checklist
-
I have read the contributing guidelines -
My code follows the code style of the project (using npm run lint
) -
My change introduces changes to the documentation -
I have updated the documentation accordingly -
I have added tests to cover my changes -
All new and existing tests passed
Live previews
Related issues
rel: #37442