batch function

void batch(
  1. void updates()
)

============================================================================ EFFECT HELPER ON CONTROLLER

============================================================================ BATCHED UPDATES

Batch multiple signal updates into a single notification.

This is useful when you need to update multiple signals and only want to trigger UI rebuilds once.

Example:

void updateUser(User user) {
  batch(() {
    name.emit(user.name);
    age.emit(user.age);
    email.emit(user.email);
  });
  // UI rebuilds only once here
}

Implementation

// Effect method is now built into NeuronController class

/// ============================================================================
/// BATCHED UPDATES
/// ============================================================================

/// Batch multiple signal updates into a single notification.
///
/// This is useful when you need to update multiple signals and only
/// want to trigger UI rebuilds once.
///
/// Example:
/// ```dart
/// void updateUser(User user) {
///   batch(() {
///     name.emit(user.name);
///     age.emit(user.age);
///     email.emit(user.email);
///   });
///   // UI rebuilds only once here
/// }
/// ```
void batch(void Function() updates) {
  // For now, just execute immediately
  // In a more advanced implementation, you could defer notifications
  updates();
}