Conditions | 3 |
Total Lines | 11 |
Code Lines | 2 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | from ..protocol import Observable |
||
7 | def rx_max(observable: Observable) -> Observable: |
||
8 | """Create an observable wich returns the maximal item in the source when completes. |
||
9 | |||
10 | Args: |
||
11 | observable (observable): the observable source |
||
12 | |||
13 | Returns: |
||
14 | (Observable): observable instance |
||
15 | |||
16 | """ |
||
17 | return rx_reduce(observable=observable, accumulator=lambda a, b: max(a, b) if a else b) |
||
18 |