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
MotionObservable Inline connection type
Status Interface level Implementation level Library
Stable as of March 2, 2017 L2: Interaction creator L4: Runtime engineering material-motion

Inline connection specification

This is the engineering specification for an inline MotionObservable connection implementation.

MVP

Return a motion observable

return MotionObservable { observer in
  // Connect to a source
  return {
    // Disconnect from the source
  }
}

Instantiate the source inline

return MotionObservable { observer in
  let someSource = Source()
  
  ...
}

Start the source on connection

This should be done after configuring the source and before returning the disconnect method.

return MotionObservable { observer in
  ...
  
  someSource.start()
  
  return {
    ...
  }
}

Stop the source on disconnection

This may require some amount of teardown to occur.

return MotionObservable { observer in
  ...
  return {
    someSource.stop()
  }
}