Dimillian / SwiftUIFlux

A very naive implementation of Redux using Combine BindableObject to serve as an example
Apache License 2.0
654 stars 62 forks source link

cause hight cpu usage to 100%, when swipe back with gesture #10

Open oblank opened 4 years ago

oblank commented 4 years ago

when AView.sheet(BView) with navigation。

B view is a list, with codes:

...
.onAppear {
            store.dispatch(action: TasksActions.FetchMine())
 }
...

1, touch BView's list item , navigation into CView (just a detail view) 2, now, swipe back a little with gesture(C->B), and then cancel swipe,will recreate this issues

when comment store.dispatch... ,it work well

ethanyuwang commented 4 years ago

I'm seeing some low frames when navigation and store.dispatch happen at the same time too. Did you fix this?

djrobby commented 3 years ago

Have you guys tried the following:


.onAppear {
  DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
    store.dispatch(action: TasksActions.FetchMine())
  }
}