delayBy specification
This is the engineering specification for the MotionObservable
operator: delayBy
.
Overview
delayBy
emits values from upstream after a specified delay amount.
Example usage
stream.delay(by: 0.3)
time | upstream | downstream
0 | 20 |
0.1 | |
0.2 | 80 |
0.3 | | 20
0.4 | |
0.5 | | 80
MVP
Expose a delayBy operator API
Use _nextOperator
to implement the operator. Emit values after the specified delay has passed.
class MotionObservable<T> {
public func delay(by: CGFloat) -> MotionObservable<T>
Cancel the delayed invocation on unsubscription
Unsubscription should cancel any timers that have not yet been fired.