我有一个小型的flutter应用,使用redux进行飞镖。 我目前正在将redux_thunk用于异步操作,并且效果很好。到目前为止,我的异步操作只包含这样的伪代码:
void action(Store<String> store) async {
final searchResults = await new Future.delayed(
new Duration(seconds: 1),() => "Search Results",);
store.dispatch(searchResults);
}
现在,我想在服务(例如Firestore)中调用方法,但是重击操作仅将store作为参数。那么我如何将服务传递到操作中?
想知道,因为我找不到任何好的模式示例。
但是它具有所有异步动作作为我特别不喜欢的中间件的一部分。