Skip to content

struct State with enum Properties #609

Answered by mbrandonw
tgt asked this question in Q&A
Discussion options

You must be logged in to vote

Is this how you meant your suggestion to be implemented?

Yeah this is exactly right. In a future release of TCA and swift-case-paths you will be able to collapse that into a single pullback by appending a case path to a key path.

I'm now wondering how to use the onChange(of:) helper from isowords with this.

Ah yes, one option is to open a closure to do the extraction of the case:

.onChange(of: { (/Feature.first).extract(from: $0.feature) }) { ... }

That's a bit intense, but it should work. Alternatively you could define a getter computed property var first: FirstFeature? on Feature to do the extraction.

Is there a recommended way to cancel outstanding effects on one of the child redu…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tgt
Comment options

Answer selected by tgt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants