StreamMapper

open class StreamMapper<WRAPPED, RESULT>(    wrapped: Stream<WRAPPED>,     mapper: (WRAPPED) -> RESULT,     initial: () -> RESULT = { mapper(wrapped()) }) : StreamWrapperBase<WRAPPED, RESULT>

Base class for stream wrappers that map the value type from WRAPPED to RESULT

Parameters

WRAPPED

The value type of the wrapped stream

RESULT

The value type of the resulting stream

Constructors

Link copied to clipboard
fun <WRAPPED, RESULT> StreamMapper(    wrapped: Stream<WRAPPED>,     mapper: (WRAPPED) -> RESULT,     initial: () -> RESULT = { mapper(wrapped()) })

Functions

Link copied to clipboard
open operator override fun invoke(): RESULT

Returns the current value of the stream

Link copied to clipboard
open override fun subscribeToStream(sub: StreamHandler<RESULT>): Unsubscribe

Adds a subscription to the stream.