-
I'm sure there's a quick and easy way around this but if I set my state variable to [] it works but when I put values in there I get: Cannot assign value of type '[Post]' to type 'IdentifiedArrayOf' (aka 'IdentifiedArray<UUID, Post>') |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@dadixon It looks like you're encountering a type mismatch, where you have a plain |
Beta Was this translation helpful? Give feedback.
-
`struct PostsState: Equatable { switch action { case let getPosts(posts): let posts = [ |
Beta Was this translation helpful? Give feedback.
`struct PostsState: Equatable {
var posts: IdentifiedArrayOf = []
}
switch action {
case let getPosts(posts):
state.posts = posts
}
let posts = [
PostState(id, other values),
PostState(id, other values),
PostState(id, other values)
}`