[added] Tossable
Needs ReviewPublic

Authored by appsforartists on May 24 2017, 7:30 PM.

Diff Detail

Repository
R13 material-motion/material-motion-js
Lint
Lint OK
Unit
No Unit Test Coverage
appsforartists created this revision.May 24 2017, 7:30 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptMay 24 2017, 7:30 PM
Restricted Application added a project: Material Motion. · View Herald Transcript
Restricted Application added a reviewer: O3: Material JavaScript platform reviewers. · View Herald Transcript
Restricted Application added a reviewer: Material Motion. · View Herald Transcript
Restricted Application completed building Restricted Buildable.May 24 2017, 7:33 PM
featherless added inline comments.
packages/core/src/interactions/Tossable.ts
63

What's the location$ argument for?

appsforartists added inline comments.May 30 2017, 5:22 PM
packages/core/src/interactions/Tossable.ts
63

It's used on lines 97 and 111 to feed the current location of the dragged element into spring.initialValue and out as tossable.value$.

I know in the V2 proposal, you're passing the target element itself into the interactions and letting the interactions handle style application internally. I've avoided that so far because I don't know what abstraction to use (raw DOM elements? some adaptor around them?) or if those will compose well. It's something we can get to eventually, but for now, the interactions I've been using are purely reactive, so I'm feeding input streams into the constructor and dispatching output as value$.