Observable biểu diễn stream theo thời gian, có cancellation, operators mạnh và phù hợp với HTTP, WebSocket, router events hoặc async pipelines.
Bridge khi cần đưa stream vào template signal-based:
const user$ = this.http.get<User>("/api/me")
const user = toSignal(user$, { initialValue: null })
const userChanges$ = toObservable(user)Signal biểu diễn current value đồng bộ, đọc trực tiếp trong template và phù hợp với local UI state.
Trong app thực tế thường dùng cả hai: Observable cho event/data stream, Signal cho state hiển thị.
An Observable represents a stream over time, supports cancellation, has powerful operators and fits HTTP, WebSocket, router events or async pipelines.
Bridge when a stream needs to feed signal-based UI:
const user$ = this.http.get<User>("/api/me")
const user = toSignal(user$, { initialValue: null })
const userChanges$ = toObservable(user)A Signal represents a synchronous current value, is read directly in templates and fits local UI state.
Real apps often use both: Observables for event/data streams, Signals for displayed state.