Slide 37
Slide 37 text
struct Recorder: Codable {
struct Event: Codable {
let date: Date,
let props: Props
}
var history: [Event]
func record(props: Props, date: Date = Date()) {
history.append(Event(date: date, props: props))
}
func replay(with render: @escaping (Props) -> ()) {
...
}
by @DAlooG // 2017 @ GDG Dev Fest