DematerializeStreamTransformer<T> class

Converts the onData, onDone, and onError Notification objects from a materialized stream into normal onData, onDone, and onError events.

When a stream has been materialized, it emits onData, onDone, and onError events as Notification objects. Dematerialize simply reverses this by transforming Notification objects back to a normal stream of events.

Example

new Stream<Notification<int>>
    .fromIterable([new Notification.onData(1), new Notification.onDone()])
    .transform(dematerializeTransformer())
    .listen((i) => print(i)); // Prints 1

Error example

new Stream<Notification<int>>
    .fromIterable([new Notification.onError(new Exception(), null)])
    .transform(dematerializeTransformer())
    .listen(null, onError: (e, s) { print(e) }); // Prints Exception
Inheritance

Constructors

DematerializeStreamTransformer()

Properties

transformer StreamTransformer<Notification<T>, T>
final
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

bind(Stream<Notification<T>> stream) Stream<T>
Transforms the provided stream. [...]
override
cast<RS, RT>() StreamTransformer<RS, RT>
Provides a StreamTransformer<RS, RT> view of this stream transformer. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited