Closed lcdsmao closed 3 years ago
StateNotifier was updated to filter values using identical
, and this behaviour was documented.
I would expect this to be a solution for simple cases like you described (numbers/enums), without performance impact on complex objects.
Describe what scenario you think is uncovered by the existing examples/articles I noticed that StateNotifier's listener will be called when updated with the same value, which is different from ValueNotifier. Maybe it's better to clarify this in the section of
Differences with ValueNotifier
. Describe why existing examples/articles do not cover this case Test code:
Additional context When using
ref.listen
(riverpod 1.0.0) to listening to aStateNotifierProvider
for showing snackbar., I noticed this different behavior from ValueNotifier.