[refactored] _map to use named args
ClosedPublic

Authored by appsforartists on Oct 6 2017, 11:50 PM.

Diff Detail

Repository
R13 material-motion/material-motion-js
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
appsforartists created this revision.Oct 6 2017, 11:50 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptOct 6 2017, 11:50 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.Oct 6 2017, 11:53 PM
vietanh accepted this revision.Oct 10 2017, 7:46 PM
vietanh added a subscriber: vietanh.
vietanh added inline comments.
packages/core/src/interactions/NumericSpring.ts
286

I'm not familiar with this syntax: "transform(value: T) {..."
Does this still return a function as the original code did?

This revision is now accepted and ready to land.Oct 10 2017, 7:46 PM
appsforartists added inline comments.Oct 10 2017, 8:10 PM
packages/core/src/interactions/NumericSpring.ts
286

Yup. These two are equivalent:

{
  transform: function (value) { 
    return value 
  }
}
{
  transform (value) { 
    return value 
  }
}

The second is a more modern shorthand. I believe it was introduced in ES2015.

This revision was automatically updated to reflect the committed changes.