Skip to content

Identifiable Array and TestStore #1074

Answered by stephencelis
ivangodfather asked this question in Q&A
Discussion options

You must be logged in to vote

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 the id-based subscript:

let id = UUID(uuidString: "00000000-0000-0000-0000-000000000000")!

store.send(.todo(id: id, action: .checkboxTapped) {
  $0.todos[id: id]!.isComplete = true
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ivangodfather
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
Converted from issue

This discussion was converted from issue #1073 on May 02, 2022 21:08.