Created
December 21, 2019 13:06
-
-
Save nalexn/bc9924e9326337fc037aea6f775a769d 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
struct CustomView: View { | |
@EnvironmentObject var appState: Deduplicated<AppState, Snapshot> | |
var body: some View { | |
Text("Value: \(appState.value)") | |
} | |
} | |
let view = CustomView() | |
.environmentObject(appState | |
.deduplicated { Snapshot(value: $0.value) }) | |
extension CustomView { | |
struct Snapshot { | |
let value: Int | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment