Skip to content

Commit

Permalink
fix(transducers): update dedupe() w/ predicate arg
Browse files Browse the repository at this point in the history
- if pred is given, do not call pred for 1st value (always passes)
  • Loading branch information
postspectacular committed Mar 2, 2019
1 parent e43f57c commit c414423
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/transducers/src/xform/dedupe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ export function dedupe<T>(...args: any[]): any {
rfn,
equiv
? (acc, x: T) => {
acc = equiv(prev, x) ? acc : r(acc, x);
acc =
prev !== SEMAPHORE && equiv(prev, x)
? acc
: r(acc, x);
prev = x;
return acc;
}
Expand Down

0 comments on commit c414423

Please sign in to comment.