Identifiable Array and TestStore #1074
Answered
by
stephencelis
ivangodfather
asked this question in
Q&A
-
While doing the TCA tour videos I got stuck if I change the signature of the todo's to IdentifiedArrayOf (the suggested one).
|
Beta Was this translation helpful? Give feedback.
Answered by
stephencelis
May 2, 2022
Replies: 1 comment
-
Hi @ivangodfather! Although many of the core principles remain the same from those episodes, there have been a bunch of API changes since recording. The main issue here is that let id = UUID(uuidString: "00000000-0000-0000-0000-000000000000")!
store.send(.todo(id: id, action: .checkboxTapped) {
$0.todos[id: id]!.isComplete = true
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ivangodfather
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @ivangodfather! Although many of the core principles remain the same from those episodes, there have been a bunch of API changes since recording.
The main issue here is that
IdentifiedArray
cannot be mutated via its index. Instead, you should be able to use theid
-based subscript: