getActiveSub function

ReactiveNode? getActiveSub()

Returns the effect or computed currently being tracked.

Example:

final currentlyTracking = getActiveSub();
if (currentlyTracking != null) {
  // mutate diagnostics
}

Implementation

@pragma("vm:prefer-inline")
@pragma("wasm:prefer-inline")
@pragma("dart2js:prefer-inline")

/// Returns the effect or computed currently being tracked.
///
/// Example:
/// ```dart
/// final currentlyTracking = getActiveSub();
/// if (currentlyTracking != null) {
///   // mutate diagnostics
/// }
/// ```
ReactiveNode? getActiveSub() => activeSub;