enableAutoLinking static method

void enableAutoLinking()

Enables the "Auto-Linking" feature.

When enabled, any LxReactive variable created inside a Levit.put builder or LevitController.onInit is automatically registered for cleanup with its parent controller.

This ensures that transient state created within business logic components is deterministically cleaned up without manual tracking.

Implementation

static void enableAutoLinking() {
  Lx.addMiddleware(_AutoLinkMiddleware());
  LevitScope.addMiddleware(_AutoDisposeMiddleware());
}