struct Post {
let id: ID
let author: User.ID
let comments: [Comment.ID]
let text: String
struct ID: Hashable {
let value: String
}
}
Slide 35
Slide 35 text
struct User {
let id: ID
let posts: [Post.ID]
let comments: [Comment.ID]
let name: String
let avatar: URL
struct ID: Hashable {
let value: String
}
}
Slide 36
Slide 36 text
struct Comment {
let id: ID
let author: User.ID
let post: Post.ID
let text: String
struct ID: Hashable {
let value: String
}
}
Slide 37
Slide 37 text
struct State {
let posts: [Post.ID: Post]
let users: [User.ID: User]
let comments: [Comment.ID: Comment]
let feed: [Post.ID]
let currentUser: User.ID
}