What's the difference between "pipeable" and "creation" operators?
RxJS has two types of operators:
1. Creation Operators
Create a new Observable from scratch.
Examples:
of(1, 2, 3)from([10, 20, 30])interval(1000)timer(2000)fromEvent(button, 'click')
They say: "Start the stream here."
2. Pipeable Operators
Process data inside an already existing stream.
You use them inside .pipe(...).
Examples:
map(x => x * 2)filter(x => x > 10)take(3)debounceTime(300)switchMap(...)
They say: "Once the stream is flowing, change it, slow it down, pick what you need."
Example together:
ts
import { of } from 'rxjs';
import { map, filter } from 'rxjs/operators';
of(1, 2, 3, 4) // ← creation operator
.pipe( // ← pipeable operators
filter(x => x % 2 === 0),
map(x => x * 10)
)
.subscribe(console.log);Conclusion:
| Type | What it does | Where it's used |
|---|---|---|
| Creation | Creates a stream | of(), from(), interval() |
| Pipeable | Changes a stream | inside .pipe(...) |
One starts the river. The other sets up filters and bends.
Short Answer
Interview readyPremium
A concise answer to help you respond confidently on this topic during an interview.