This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a new Observable object class to allow the views to observed usign the @StateObject annotation | |
final class RemindersViewModelWrapper: ObservableObject { | |
let viewModel = RemindersViewModel() | |
@Published private(set) var reminders: [Reminder] = [] // stream that the view will listen to within the Obeservable Object | |
init() { | |
viewModel.onRemindersUpdated = { [weak self] items in | |
self?.reminders = items |