async_rx.observable.rx_first   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 6
dl 0
loc 18
rs 10
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A rx_first() 0 11 1
1
from ..protocol import Observable
2
from .rx_take import rx_take
3
4
__all__ = ["rx_first"]
5
6
7
def rx_first(observable: Observable) -> Observable:
8
    """Create an observale which only take the first event and complete.
9
10
    Args:
11
        observable (Observable): observable source
12
13
    Returns:
14
        (Observable): observable instance
15
16
    """
17
    return rx_take(observable=observable, count=1)
18