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
$._nextOperator log
visualize
Status Interface level Implementation level Library
Stable as of February 20, 2017 L2: Interaction creator L3: Stream creator material-motion
UpdatesCurrent StatusInitiation dateCompletion date
Added optional string prefix arg. Stable March 29, 2017
platformsrctests
Android View
iOS (Swift) View
JavaScript View View
log
upstream (T)
(T) downstream

log specification

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

Overview

log writes any upstream value to the console and emits the value without modification.

Example usage:

stream.log()

upstream  |  downstream
20        |  20
40        |  40
80        |  80

console
20
40
80
stream.log(prefix: "The value is:")

upstream  |  downstream
20        |  20
40        |  40
80        |  80

console
The value is: 20
The value is: 40
The value is: 80

MVP

Expose a log operator API

Use _nextOperator to implement the operator. Accept an optional prefix string.

class MotionObservable {
  public func log(prefix: String? = nil) -> MotionObservable<T>