I have a scenario where I want to take only the first value of a certain type and then take the next different value which is of a different type.
To understand let's consider the following:
of(1,1,1,1,2,3,4)
.pipe(
// some operators
)
.subscribe(val => console.log(val);
I am only interested in the output 1,2,3,4
note that the 1 in the output should be the first value in the source and not the one before 2.
how do I achieve this using rxjs
operators?
So given 111223111
If you want to get 123 use distinct operator
If you want to get 1231 use distinctUntilChanged operator