0

All

I often find myself writing the code like following:

// A, B - are properties defined elsewhere.
let C = Bacon.update(
    null,

    [
        A,
        B,
        Bacon.mergeAll(A.changes(), B.changes())
    ],
    (_, a, b) => getC(a, b)

);

To me it looks like a sort of DRY violation and poor readability. How could the code above be improved?

1 Answers1

0

Why not

let C = Bacon.combineWith(A, B, getC)

Or

let C = A.combine(B, getC)

... which is equivalent.

raimohanska
  • 3,265
  • 17
  • 28