Closed ohitsdaniel closed 3 years ago
Swift complains about not being able to infer complex return types when actions are performed as part of PathBuilder build closures.
Example
PathBuilders.if { (screen: Screen) in print("Hello") return PathBuilders.empty }
fails to build, but
PathBuilders.if { (screen: Screen) in return PathBuilders.empty }
succeeds.
The beforeBuild helper allows you to perform actions (like sending actions into a ViewStore) everytime a path is built.
PathBuilders.if { (screen: Screen) in return PathBuilders.empty.beforeBuild { print("Hello") } }
Swift complains about not being able to infer complex return types when actions are performed as part of PathBuilder build closures.
Example
fails to build, but
succeeds.
The beforeBuild helper allows you to perform actions (like sending actions into a ViewStore) everytime a path is built.