Class: Stream

Stream

new Stream()

A lightweight readable stream implemention that handles event dispatching.
Source:

Methods

dispose()

Destroys the stream and cleans up.
Source:

off(type, listener) → {Boolean}

Remove a listener for a specified event type.
Parameters:
Name Type Description
type String the event name
listener function a function previously registered for this type of event through `on`
Source:
Returns:
if we could turn it off or not
Type
Boolean

on(type, listener)

Add a listener for a specified event type.
Parameters:
Name Type Description
type String the event name
listener function the callback to be invoked when an event of the specified type occurs
Source:

pipe(destination)

Forwards all `data` events on this stream to the destination stream. The destination stream should provide a method `push` to receive the data events as they arrive.
Parameters:
Name Type Description
destination Stream the stream that will receive all `data` events
Source:
See:

trigger(type)

Trigger an event of the specified type on this stream. Any additional arguments to this function are passed as parameters to event listeners.
Parameters:
Name Type Description
type String the event name
Source: