Restire MobX actions on lists

I previously had to remove the `@action` annotation on some methods due
to an update in the MobX package. The change has since been reverted so
I've decided to add back the annotations.
This commit is contained in:
Tommy Chow 2022-07-28 01:33:53 -04:00
parent 84c814d1f9
commit 2ab0d631b1
4 changed files with 18 additions and 0 deletions

View file

@ -40,6 +40,7 @@ abstract class CategoriesStoreBase with Store {
}
// Fetches the top categories based on the current cursor.
@action
Future<void> getCategories() async {
_isLoading = true;

View file

@ -70,6 +70,14 @@ mixin _$CategoriesStore on CategoriesStoreBase, Store {
});
}
late final _$getCategoriesAsyncAction =
AsyncAction('CategoriesStoreBase.getCategories', context: context);
@override
Future<void> getCategories() {
return _$getCategoriesAsyncAction.run(() => super.getCategories());
}
late final _$CategoriesStoreBaseActionController =
ActionController(name: 'CategoriesStoreBase', context: context);

View file

@ -78,6 +78,7 @@ abstract class ListStoreBase with Store {
}
/// Fetches the streams based on the type and current cursor.
@action
Future<void> getStreams() async {
_isLoading = true;

View file

@ -93,6 +93,14 @@ mixin _$ListStore on ListStoreBase, Store {
});
}
late final _$getStreamsAsyncAction =
AsyncAction('ListStoreBase.getStreams', context: context);
@override
Future<void> getStreams() {
return _$getStreamsAsyncAction.run(() => super.getStreams());
}
late final _$ListStoreBaseActionController =
ActionController(name: 'ListStoreBase', context: context);