Method Map
- Namespace
- SodaFlow
- Assembly
- SodaFlow.dll
Map<T, TResult>(Stream<T>, Func<T, TResult>)
Transforms the values of a stream with the given function. The stream from this call has the value of that function on the value of the input stream.
public static Stream<TResult> Map<T, TResult>(this Stream<T> s, Func<T, TResult> f)
Parameters
sStream<T>The stream.
fFunc<T, TResult>Function to apply to change the values. It can make FRP logic or use Sample<T>(Cell<T>), in which case it is equivalent to calling Snapshot<T, TResult>(Stream<T>, Cell<TResult>) on the cell. Other than this, the function must be a pure function.
Returns
- Stream<TResult>
A stream which fires values transformed by
ffor each value fired by this stream.
Type Parameters
TThe type of the stream.
TResultThe type of values fired by the returned stream.