L
L
Levingstone2020-10-01 08:59:32
Angular
Levingstone, 2020-10-01 08:59:32

How to execute function first in combineLatest?

There are observable variables, they are combined in combineLatest. You need to execute the third-party observable function on the thread before the switchMap is executed.

Start With fails with error TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator)

)

combineLatest([var1, var2]).pipe(
      startWith(this.func),
      switchMap(([var1, var2) => this.getCurrent(var1, var2)
    )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Shvedov, 2020-10-01
@mmmaaak

tap

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question