codejump

Higher-Order Observables

Preview — 3 of 10 questions

How do you create a reusable custom RxJS operator?

AExtend the Observable class and override the pipe() method
BImplement the OperatorFunction<T, R> interface as a class
CUse the createOperator() factory function from rxjs/operators
DWrite a function that takes an Observable<T> and returns an Observable<R>, composing existing operators inside

What is a higher-order Observable and how do flattening operators handle them?

AAn Observable that emits values with higher priority than regular Observables
BAn Observable that emits other Observables as values, requiring a flattening operator to access the inner values
CAn Observable created from a Promise or async/await
DAn Observable that runs on a Scheduler instead of the default micro-task queue

What is an RxJS Scheduler and when would you use asyncScheduler vs queueScheduler?

ASchedulers define the thread on which Observables execute
BasyncScheduler is for HTTP calls; queueScheduler is for UI events
CSchedulers control the timing of Observable subscriptions and emissions; asyncScheduler dispatches via setTimeout; queueScheduler uses a synchronous queue (FIFO)
DSchedulers are deprecated in RxJS 7 — use requestAnimationFrame directly

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.