thresholdRange specification
This is the engineering specification for the MotionObservable
operator: thresholdRange
.
Overview
thresholdRange
emits a value based on the incoming value’s position around a threshold range.
Example usage
stream.thresholdRange(min: 50, max: 100)
upstream min max | downstream
20 50 100 | .below
50 50 100 | .within
100 50 100 | .within
120 50 100 | .above
MVP
Expose a thresholdRange operator API
Use _nextOperator
to implement the operator. Accept a threshold minimum and maximum value.
class MotionObservable<number> {
public func thresholdRange(min: number, max: number) -> MotionObservable<ThresholdSide>