Skip to content

Commit

Permalink
code examples in swift collection posts fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
mecid committed Feb 20, 2024
1 parent 7746e27 commit feb2497
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _posts/2024-02-19-discovering-swift-collections-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct Event: Identifiable, Comparable {
@Observable final class EventStore {
typealias Fetch = () async -> [Event]

private(set) var events: Heap<Event>
private(set) var events: Heap<Event> = []
private let fetch: Fetch

init(fetch: @escaping Fetch) {
Expand All @@ -83,7 +83,7 @@ As you can see in the example above, we fetch the calendar events and populate t

```swift
@Observable final class EventStore {
private(set) var events: Heap<Event>
private(set) var events: Heap<Event> = []

func printEvents() {
for event in events.unordered {
Expand Down

0 comments on commit feb2497

Please sign in to comment.