Skip to content
Discussion options

You must be logged in to vote

State sharing can be tricky in TCA! Do not fret, you'll soon get the hang of it :)

The construct you're looking for is forEach, where you swap out your todos array with an IdentifiedArray of your TodoListFeature.State and put in the Todo struct inside the TodoListFeature.State.

See:

.forEach(\.todos, action: /Action.todo(id:action:)) {

I also encourage you to look at the case studies. One example is a mini Todos app! It should contain the best practices, feel free to let me know any questions you may have.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@beaneyios
Comment options

@beaneyios
Comment options

@mariob
Comment options

@beaneyios
Comment options

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