1. Domino Brix
  2. Presenter lifecycle
  3. Deactivation & teardown

Deactivation & teardown

Deactivation cleans up listeners, slots, and navigation interceptors. Detach handles view removal; teardown resets cached instances so a fresh presenter/view is created on the next activation.

Triggers

  • Router token no longer matches.
  • Explicit deactivate() call.
  • Slot removal detaches the view and can cascade to deactivation.

Steps

  • Remove the view from its slot if attached.
  • Remove event/slot listeners and navigation interceptor.
  • Mark inactive, call onDeactivated(), reset the component provider.
			@BrixPresenter
@BrixRoute("dashboard")
@BrixSlot(BrixSlots.BRIX_BODY_SLOT)
public class DashboardPresenter extends Presenter<DashboardView> {
  // No manual view binding needed
}

@UiView
public class DashboardView extends BrixView<Element, DashboardHandlers>
    implements DashboardPresenter.DashboardView {
  @Handlers DashboardHandlers handlers;
}

		

After reset, a new presenter/view is constructed on the next matching route. Persist important state in services or stores rather than the presenter.

We are a group of passionate people who love what we do

Donate & Support Us