docs: clarify observables doc with new titles and tooltips (#36023)
PR Close #36023
This commit is contained in:
parent
1c385a1c22
commit
8e0dec538e
|
@ -1,9 +1,13 @@
|
||||||
|
# Using observables to pass values
|
||||||
|
|
||||||
# Observables
|
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.
|
||||||
|
|
||||||
Observables provide support for passing messages between publishers and subscribers in your application. Observables offer significant benefits over other techniques 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.
|
||||||
|
|
||||||
Observables are declarative—that is, you define a function for publishing values, but it is not executed until a consumer subscribes to it. The subscribed consumer then receives notifications until the function completes, or until they unsubscribe.
|
Observables are declarative—that is, you define a function for publishing values, but it is not executed until a consumer subscribes to it.
|
||||||
|
The subscribed consumer then receives notifications until the function completes, or until they unsubscribe.
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|
||||||
|
|
|
@ -272,28 +272,28 @@
|
||||||
"children": [
|
"children": [
|
||||||
{
|
{
|
||||||
"url": "guide/observables",
|
"url": "guide/observables",
|
||||||
"title": "Observables",
|
"title": "Observables Overview",
|
||||||
"tooltip": ""
|
"tooltip": "Using observables to pass values synchronously or asynchronously."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/rx-library",
|
"url": "guide/rx-library",
|
||||||
"title": "The RxJS Library",
|
"title": "The RxJS Library",
|
||||||
"tooltip": ""
|
"tooltip": "The RxJS library provides useful operators."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/observables-in-angular",
|
"url": "guide/observables-in-angular",
|
||||||
"title": "Observables in Angular",
|
"title": "Observables in Angular",
|
||||||
"tooltip": ""
|
"tooltip": "How Angular subsystems make us of observables."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/practical-observable-usage",
|
"url": "guide/practical-observable-usage",
|
||||||
"title": "Practical Usage",
|
"title": "Practical Usage",
|
||||||
"tooltip": ""
|
"tooltip": "Domains in which observables are useful."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"url": "guide/comparing-observables",
|
"url": "guide/comparing-observables",
|
||||||
"title": "Compare to Other Techniques",
|
"title": "Compare to Other Techniques",
|
||||||
"tooltip": ""
|
"tooltip": "How observables compare to promises and other message passing techniques."
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue