Skip to content

Commit

Permalink
feat: add refresh method in Obs
Browse files Browse the repository at this point in the history
  • Loading branch information
albinpk committed Oct 2, 2024
1 parent 386f8e6 commit 7b452f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/obs_state_mixin/lib/src/obs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class Obs<T> extends ValueNotifier<T> {
/// Creates a new [Obs] with the given [value].
Obs(super.value);

/// Notifies listeners that the value has changed.
void refresh() => notifyListeners();

/// A string representation of the [Obs].
@override
String toString() => value.toString();
Expand Down

0 comments on commit 7b452f4

Please sign in to comment.