Skip to content
Discussion options

You must be logged in to vote

If you just want to affect the first, then you need to get the ID of the first element:

guard let firstID = state.children.first?.id
else { return .none }

return state.children[id: firstID]!.playCurrent().map(Action.child) 

I recommend reading the docs for IdentifiedArray to better understand how to use that type.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@jerryga
Comment options

@mbrandonw
Comment options

@jerryga
Comment options

@mbrandonw
Comment options

Answer selected by jerryga
@jerryga
Comment options

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