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:
parent
84c814d1f9
commit
2ab0d631b1
4 changed files with 18 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue