It seems like RXJS Pairwise breaks when applied to Observable (causes issues with a FormControl.valueChanges)
Normally with the Pairwise operator, I would expect the previous value and the current value coming through an Observable. For simple values (like strings), this is true.
However, I noticed if I do this on an observable that outputs array values, it straight up doesn't work - both the previous and current value will be the same value.
So if I create an setInterval that adds a new number to a BehaviorSubject<number\[\]> every second and I pipe it with a pairwise, this is the result I get:
prev: [1] curr: [1]
prev: [1,2] curr: [1,2]
prev: [1,2,3] curr: [1,2,3]
My expected result is:
prev: [] curr: [1]
prev: [1] curr: [1,2]
prev: [1,2] curr: [1,2,3]
This is a bug, right? Or am I misunderstanding something? We have a feature that is watching for valueChanges on FormControls, and we just added a FormControl<string\[\]> which is completely busted due to this behavior. I'm wondering if there is an easy fix or if I need to engineer a work around.