trackComputedCreation static method

void trackComputedCreation(
  1. Computed computed,
  2. String? name
)

Track Computed creation (only called when enabled) Internal use only - called from Computed constructor

Implementation

static void trackComputedCreation(Computed<dynamic> computed, String? name) {
  if (!_enabled || !_trackDependencies) return;

  final id = getComputedId(computed);
  _computedRegistry[id] = _ComputedInfo(
    id: id,
    name: name ?? computed.runtimeType.toString(),
    type: computed.runtimeType.toString(),
    createdAt: DateTime.now(),
  );

  // Store reference for state inspector
  _computedRefs[id] = computed;

  _stateNodes[id] = _StateNode(
    id: id,
    type: 'Computed',
    name: name ?? computed.runtimeType.toString(),
  );
}