Streams.Observable Class
Extends Streams.SimpleStream
Defined in:
samsara/streams/SizeObservable.js:8
A SizeObservable is a stream for resize events set discretely in time, as opposed to continuously.
It emits appropriate resize
events upon calling the set
method.
Constructor
Methods
filter
(
-
filterFn
Filter converts the current stream into a new stream
that only emits if the filter condition is satisfied.
The function should return a Boolean.
Parameters:
-
filterFn
FunctionFunction to filter event payload
get
()
Number, String, Array, Object
Getter for the provided value.
Returns:
Number, String, Array, Object:
map
(
-
mapperFn
Map converts the current stream into a new stream
with a modified (mapped) data payload.
Parameters:
-
mapperFn
FunctionFunction to map event payload
pluck
(
-
key
Pluck is an opinionated mapper. It projects a Stream
onto one of its return values.
Useful if a Stream returns an array or an object.
set
(
-
value
Setter for the provided value.
Parameters:
-
value
Number, String, Array, ObjectValue
split
(
-
splitterFn
Split maps one of several streams based on custom logic.
The function should return an EventEmitter.
Parameters:
-
splitterFn
FunctionSplitter function