Skip to content

Commit

Permalink
[refactored] EqualityCheck type to use upper case
Browse files Browse the repository at this point in the history
Reviewers: O2 Material Motion, O3 Material JavaScript platform reviewers, #material_motion, markwei

Reviewed By: O2 Material Motion, #material_motion, markwei

Tags: #material_motion

Differential Revision: http://codereview.cc/D3073
  • Loading branch information
appsforartists committed Apr 20, 2017
1 parent 565e008 commit ddd8f40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/operators/dedupe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ import * as deepEqual from 'deep-equal';

import {
Constructor,
EqualityCheck,
NextChannel,
Observable,
ObservableWithFoundationalMotionOperators,
equalityCheck,
} from '../types';

export interface MotionDeduplicable<T> {
dedupe(areEqual: equalityCheck): Observable<T>;
dedupe(areEqual?: EqualityCheck): Observable<T>;
}

export function withDedupe<T, S extends Constructor<ObservableWithFoundationalMotionOperators<T>>>(superclass: S): S & Constructor<MotionDeduplicable<T>> {
return class extends superclass implements MotionDeduplicable<T> {
/**
* Ensures that every value dispatched is different than the previous one.
*/
dedupe(areEqual: equalityCheck = deepEqual): Observable<T> {
dedupe(areEqual: EqualityCheck = deepEqual): Observable<T> {
let dispatched = false;
let lastValue: T;

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export interface MotionElement {
getEvent$(type: string): MotionObservable<Event>;
}

export type equalityCheck = (a: any, b: any) => boolean;
export type EqualityCheck = (a: any, b: any) => boolean;

export type SpringProperties<T> = {
state: PropertyObservable<State>,
Expand Down

0 comments on commit ddd8f40

Please sign in to comment.