Total Complexity | 1 |
Total Lines | 22 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from ..protocol import Observable, Observer, Subscription, default_subscription |
||
2 | from .rx_create import rx_create |
||
3 | |||
4 | __all__ = ["rx_empty"] |
||
5 | |||
6 | |||
7 | def rx_empty() -> Observable: |
||
8 | """Create an empty Observable. |
||
9 | |||
10 | An "empty" Observable emits only the complete notification. |
||
11 | |||
12 | Returns: |
||
13 | (Observable) observable instance |
||
14 | |||
15 | """ |
||
16 | |||
17 | async def _subscribe(an_observer: Observer) -> Subscription: |
||
18 | await an_observer.on_completed() |
||
19 | return default_subscription |
||
20 | |||
21 | return rx_create(subscribe=_subscribe) |
||
22 |