我想在reswift中实现组调度。我按以下顺序分派:
.onAppear {
self.store.dispatch(TrendingItemsAction.fetchPets())
self.store.dispatch(ProducerAction.fetchVeterineries())
self.store.dispatch(ManufacturerAction.fetchShelters())
self.store.dispatch(DamagedItemsAction.fetchPets())
self.store.dispatch(AuthAction.subscribe())
}
.onDisappear {
self.store.dispatch(TrendingItemsAction.unsubscribe())
self.store.dispatch(ProducerAction.unsubscribe())
self.store.dispatch(ManufacturerAction.unsubscribe())
self.store.dispatch(DamagedItemsAction.unsubscribe())
self.store.dispatch(FollowAction.unsubscribeFollowing())
self.store.dispatch(PostsAction.unsubscribe())
self.store.dispatch(AuthAction.unsubscribe())
}