Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created August 4, 2019 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laevandus/6ee720eaf555344376d5ace6fde30e6e to your computer and use it in GitHub Desktop.
Save laevandus/6ee720eaf555344376d5ace6fde30e6e to your computer and use it in GitHub Desktop.
final class ObservationStore<T> {
fileprivate var observationInfos = [Observation: (PartialKeyPath<T>) -> Bool]()
var observations: [Observation] {
return observationInfos.map({ $0.key })
}
func removeAll() {
observationInfos.removeAll()
}
}
struct Observation: Hashable {
fileprivate let identifier = UUID()
struct Options: OptionSet {
let rawValue: Int
static let initial = Options(rawValue: 1 << 0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment