//
//  OnboardingDataDataManager.swift
//  Feels (iOS)
//
//  Created by Trey Tartt on 2/18/22.
//

import Foundation

final class OnboardingDataDataManager: ObservableObject {
    static let shared = OnboardingDataDataManager()
    
    @Published public private(set) var savedOnboardingData = UserDefaultsStore.getOnboarding()
    
    public func updateOnboardingData(onboardingData: OnboardingData) {
        let onboardingData = UserDefaultsStore.saveOnboarding(onboardingData: onboardingData)
        savedOnboardingData = onboardingData
        LocalNotification.scheduleReminder(atTime: onboardingData.date)
    }
}
