Last active
July 31, 2022 19:09
-
-
Save vikingosegundo/2005fd5ed1d137163c93d46a099a0c04 to your computer and use it in GitHub Desktop.
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
import SwiftUI | |
import BrighterUI | |
import BrighterModel | |
@main | |
final | |
class BrighterHueApp: App { | |
init() { | |
rootHandler(.lighting(.load(.lights))) | |
rootHandler(.lighting(.load(.rooms))) | |
} | |
private let store: Store = createDiskStore() | |
private lazy var viewState: ViewState = ViewState(store: store) | |
private lazy var rootHandler: (Message) -> () | |
= createAppDomain(store:store, receivers:[viewState.handle(msg:)], rootHandler:{ self.rootHandler($0) }) | |
var body: some Scene { WindowGroup { ContentView( viewState:viewState, rootHandler:rootHandler ) } } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment