docs: clarify observables recommendation (#39237)
Observables are not the only async mechanism that Angular employs. This change respects that application developers are not required to use Observables in their own application architecture. Closes #39155 PR Close #39237
This commit is contained in:
parent
0654c05c41
commit
8f2260a073
|
@ -1,7 +1,7 @@
|
|||
# Using observables to pass values
|
||||
|
||||
Observables provide support for passing messages between parts of your application.
|
||||
They are used frequently in Angular and are the recommended technique for event handling, asynchronous programming, and handling multiple values.
|
||||
They are used frequently in Angular and are a technique for event handling, asynchronous programming, and handling multiple values.
|
||||
|
||||
The observer pattern is a software design pattern in which an object, called the *subject*, maintains a list of its dependents, called *observers*, and notifies them automatically of state changes.
|
||||
This pattern is similar (but not identical) to the [publish/subscribe](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) design pattern.
|
||||
|
@ -11,7 +11,7 @@ The subscribed consumer then receives notifications until the function completes
|
|||
|
||||
An observable can deliver multiple values of any type—literals, messages, or events, depending on the context. The API for receiving values is the same whether the values are delivered synchronously or asynchronously. Because setup and teardown logic are both handled by the observable, your application code only needs to worry about subscribing to consume values, and when done, unsubscribing. Whether the stream was keystrokes, an HTTP response, or an interval timer, the interface for listening to values and stopping listening is the same.
|
||||
|
||||
Because of these advantages, observables are used extensively within Angular, and are recommended for app development as well.
|
||||
Because of these advantages, observables are used extensively within Angular, and for app development as well.
|
||||
|
||||
## Basic usage and terms
|
||||
|
||||
|
|
Loading…
Reference in New Issue