sequenceEqual
Compares all values of two observables in sequence using an optional comparator function and returns an observable of a single boolean value representing whether or not the two sequences are equal.
Parameters
compareTo |
The observable sequence to compare the source sequence to. |
comparator |
Optional. Default is An optional function to compare each value pair |
Returns
OperatorFunction<T, boolean>
: An Observable of a single boolean value representing whether or not
the values emitted by both observables were equal in sequence.
Description
Checks to see of all values emitted by both observables are equal, in order.
sequenceEqual
subscribes to two observables and buffers incoming values from each observable. Whenever either
observable emits a value, the value is buffered and the buffers are shifted and compared from the bottom
up; If any value pair doesn't match, the returned observable will emit false
and complete. If one of the
observables completes, the operator will wait for the other observable to complete; If the other
observable emits before completing, the returned observable will emit false
and complete. If one observable never
completes or emits after the other complets, the returned observable will never complete.
Example
figure out if the Konami code matches