Raxol.UI.State.Streams (Raxol v2.0.1)
View SourceReactive streams system for real-time data flow in Raxol UI.
Refactored version with pure functional error handling patterns. All try/catch blocks have been replaced with with statements and proper error tuples.
This module provides RxJS-like reactive programming capabilities with:
- Observable streams of data
- Operators for transforming data (map, filter, reduce, etc.)
- Hot and cold observables
- Backpressure handling
- Functional error handling and retry strategies
- Subscription management
- Combining multiple streams
Summary
Functions
Combines latest values from multiple streams.
Debounces values, only emitting after a period of silence.
Filters values in the stream based on a predicate.
Creates an observable from UI events.
Creates an observable from a list of values.
Creates an observable from a range of numbers.
Creates an observable from Store state changes.
Creates an observable that emits values at regular intervals.
Transforms values in the stream using a mapping function.
Reduces values in the stream to a single value.
Skips the first N values from the stream.
Subscribes to an observable with an observer or simple next function.
Takes only the first N values from the stream.
Creates an observable that emits a single value after a delay.
Unsubscribes from an observable.
Functions
Combines latest values from multiple streams.
Debounces values, only emitting after a period of silence.
Filters values in the stream based on a predicate.
Creates an observable from UI events.
Creates an observable from a list of values.
Examples
numbers = Streams.from_list([1, 2, 3, 4, 5])
Streams.subscribe(numbers, fn x -> Log.info(x) end)
Creates an observable from a range of numbers.
Creates an observable from Store state changes.
Creates an observable that emits values at regular intervals.
Transforms values in the stream using a mapping function.
Reduces values in the stream to a single value.
Skips the first N values from the stream.
Subscribes to an observable with an observer or simple next function.
Takes only the first N values from the stream.
Creates an observable that emits a single value after a delay.
Unsubscribes from an observable.