@@ -50,6 +50,13 @@ public struct AndProperty: PropertyType {
5050 }
5151 }
5252
53+ public var signal : Signal < Bool , NoError > {
54+ let signals = terms. map { $0. signal }
55+ return combineLatest ( signals) . map { values in
56+ return values. reduce ( true ) { $0 && $1 }
57+ }
58+ }
59+
5360 /// Creates a new property with an additional conjunctive term.
5461 public func and< P : PropertyType where P. Value == Bool > ( other: P ) -> AndProperty {
5562 return AndProperty ( terms: terms + [ AnyProperty ( other) ] )
@@ -80,6 +87,13 @@ public struct OrProperty: PropertyType {
8087 }
8188 }
8289
90+ public var signal : Signal < Bool , NoError > {
91+ let signals = terms. map { $0. signal }
92+ return combineLatest ( signals) . map { values in
93+ return values. reduce ( false ) { $0 || $1 }
94+ }
95+ }
96+
8397 /// Creates a new property with an additional disjunctive term.
8498 public func or< P : PropertyType where P. Value == Bool > ( other: P ) -> OrProperty {
8599 return OrProperty ( terms: terms + [ AnyProperty ( other) ] )
@@ -108,6 +122,10 @@ public struct NotProperty: PropertyType {
108122 return source. producer. map { $0 != self . invert }
109123 }
110124
125+ public var signal : Signal < Bool , NoError > {
126+ return source. signal. map { $0 != self . invert }
127+ }
128+
111129 /// A negated property of `self`.
112130 public func not( ) -> NotProperty {
113131 return NotProperty ( source: source, invert: !invert)
0 commit comments