是否有用于同时分派所有动作的组分派?

时间:2020-03-17 05:29:01

标签: swift reswift

我想在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())

        }

0 个答案:

没有答案