shouldEmit method

  1. @override
bool shouldEmit(
  1. T oldValue,
  2. T newValue
)
override

Determines whether a value change should trigger a notification to listeners.

This method can be used to filter or throttle updates based on custom logic. If any middleware returns false, the update will not be emitted to the stream.

Parameters:

  • oldValue: The previous value before the update
  • newValue: The new current value after the update

Returns:

  • true if the update should be emitted to listeners
  • false if the update should be suppressed

Implementation

@override
bool shouldEmit(T oldValue, T newValue) {
  return true;
}