Material Motion Exploring solutions that will empower creators with the tools needed to describe and implement rich, interactive motion on any platform. Edit this page · History
$._map offsetBy
Status Interface level Implementation level Library
Stable as of February 21, 2016 L2: Interaction creator L3: Stream creator material-motion
Android View
iOS (Swift) View View
upstream (number)
(number) downstream

offsetBy specification

This is the engineering specification for the MotionObservable operator: offsetBy.


offsetBy emits the result of adding the incoming value to a given value.

Example usage:

stream.offset(by: -50)

upstream  value  |  downstream
20        -50    |  -30
40        -50    |  -10
80        -50    |   30


Expose an offsetBy operator API

Use _map to implement the operator. Accept a number value. Emit the result of incoming + value.

class MotionObservable {
  public func offset(by value: number) -> MotionObservable<number>