Files
onepilot/frogpilot/third_party/reactivex/operators/_startswith.py
T
firestar5683 d0e1db6766 StarPilot
2026-03-22 03:15:05 -05:00

29 lines
689 B
Python

from typing import Callable, TypeVar
import reactivex
from reactivex import Observable
_T = TypeVar("_T")
def start_with_(*args: _T) -> Callable[[Observable[_T]], Observable[_T]]:
def start_with(source: Observable[_T]) -> Observable[_T]:
"""Partially applied start_with operator.
Prepends a sequence of values to an observable sequence.
Example:
>>> start_with(source)
Returns:
The source sequence prepended with the specified values.
"""
start = reactivex.from_iterable(args)
sequence = [start, source]
return reactivex.concat(*sequence)
return start_with
__all__ = ["start_with_"]