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 scaledBy
Status Interface level Implementation level Library
Stable as of February 21, 2016 L2: Interaction creator L3: Stream creator material-motion
platformsrctests
Android View
iOS (Swift) View View
scaledBy
upstream (number)
(number) downstream

scaledBy specification

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

Overview

scaledBy emits the result of multiplying the incoming value by a given value.

Example usage:

stream.scaled(by: 2)

upstream  value  |  downstream
20        2      |  40
40        2      |  80
80        2      |  160

MVP

Expose a scaledBy operator API

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

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