lowerBound specification
This is the engineering specification for the MotionObservable
operator: lowerBound
.
Overview
lowerBound
emits either the incoming value or the provided minValue
, whichever is larger.
Example usage
stream.lowerBound(minValue: 0)
upstream minValue | downstream
0.50 0 | 0.50
0.25 0 | 0.25
0.00 0 | 0.00
-0.25 0 | 0.00
-0.50 0 | 0.00
MVP
Expose a lowerBound operator API
Use _map
to implement the operator. Accept a Comparable type. Emit the result of
max(upstreamValue, minValue)
.
class MotionObservable<Comparable> {
public func lowerBound(minValue: Comparable) -> MotionObservable<Comparable>