• Changed Files
  • packages/core/src/operators/dedupe.ts

[refactored] dedupe to use named args
ClosedPublic

Authored by appsforartists on Oct 6 2017, 11:53 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:53 PM
Restricted Application added a reviewer: O2: Material Motion. · View Herald TranscriptOct 6 2017, 11:53 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:58 PM
vietanh added inline comments.
packages/core/src/operators/dedupe.ts
40

i'm not familiar with this syntax, does this assign value of deepEqual to areEqual?

vietanh requested changes to this revision.Oct 10 2017, 7:59 PM
This revision now requires changes to proceed.Oct 10 2017, 7:59 PM
appsforartists added inline comments.Oct 10 2017, 8:14 PM
packages/core/src/operators/dedupe.ts
40

It's a default argument. If an object with an areEqual key is passed into this method, that value will be bound to areEqual. If not, it will fallback to deepEqual.

It's effectively the same thing as:

const areEqual = ((arguments[0] || {}).areEqual || deepEqual);
vietanh accepted this revision.Oct 10 2017, 8:26 PM
vietanh added inline comments.
packages/core/src/operators/dedupe.ts
40

thanks for explaining.

This revision is now accepted and ready to land.Oct 10 2017, 8:26 PM
This revision was automatically updated to reflect the committed changes.