Dimillian / SwiftUIFlux

A very naive implementation of Redux using Combine BindableObject to serve as an example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

use state in async action

megadidar opened this issue · comments

commented

Hello @Dimillian

Can you please tell me why state parameter in execute function is always null in async actions?

func execute(state: FluxState?, dispatch: @escaping DispatchFunction) { // state is null }

In the app I'm using my library, the state is not null.
Screenshot 2019-11-06 at 14 48 29

Maybe it's a side effect of something else?

commented

@Dimillian
Looks like it is AppState rather than Child State.
Working!
Thank you!

how do i access the child state? I tried to do something like:

state.userState

but just gets an error saying Value of type 'FluxState?' has no member 'userState'