Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait EventSource[A]trait Observable[A]trait Namedtrait Source[A]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait WritableStream[A]class MergeStream[A]class DebuggerStream[A]class DistinctStream[A]class DropStream[A]class FilterStream[A]class StreamFromSignal[A]class TakeStream[A]class DebounceStream[A]class DelayStream[A]class SyncDelayStream[A]class ThrottleStream[A]class CustomStreamSource[A]class EventBusStream[A]class ConcurrentStream[A]class SwitchSignalStream[A]class JsPromiseStream[A]class PeriodicStream[A]class AjaxStreamclass FetchStreamShow all
Members list
Value members
Concrete methods
Apply pf
to each event and emit the resulting value, or emit nothing if pf
is not defined for that event.
Apply pf
to each event and emit the resulting value, or emit nothing if pf
is not defined for that event.
Value parameters
- pf
-
Note: guarded against exceptions
Attributes
Emit x
if parent stream emits Left(x)
, do nothing otherwise
Emit x
if parent stream emits Left(x)
, do nothing otherwise
Attributes
Emit pf(x)
if parent stream emits Failure(x)
and pf
is defined for x
, do nothing otherwise
Emit pf(x)
if parent stream emits Failure(x)
and pf
is defined for x
, do nothing otherwise
Attributes
Emit x
if parent stream emits Left(x)
, do nothing otherwise
Emit x
if parent stream emits Left(x)
, do nothing otherwise
Attributes
Emit pf(x)
if parent stream emits Left(x)
and pf
is defined for x
, do nothing otherwise
Emit pf(x)
if parent stream emits Left(x)
and pf
is defined for x
, do nothing otherwise
Attributes
Apply fn
to parent stream event, and emit resulting x if it returns Some(x)
Apply fn
to parent stream event, and emit resulting x if it returns Some(x)
Value parameters
- fn
-
Note: guarded against exceptions
Attributes
Emit x
if parent stream emits Resolved(_, x, _)
, do nothing otherwise
Emit x
if parent stream emits Resolved(_, x, _)
, do nothing otherwise
Attributes
Emit pf(x)
if parent stream emits Resolved(_, x, _)
, do nothing otherwise
Emit pf(x)
if parent stream emits Resolved(_, x, _)
, do nothing otherwise
Attributes
Emit Pending(input)
if parent stream emits that, do nothing otherwise
Emit Pending(input)
if parent stream emits that, do nothing otherwise
Attributes
Emit input
if parent stream emits Pending(input)
, do nothing otherwise
Emit input
if parent stream emits Pending(input)
, do nothing otherwise
Attributes
Emit pf(Resolved(...))
if parent stream emits Resolved(...), do nothing otherwise
Emit pf(Resolved(...))
if parent stream emits Resolved(...), do nothing otherwise
Attributes
Emit pf(Resolved(...))
if parent stream emits Resolved(...) and pf
is defined for it, do nothing otherwise
Emit pf(Resolved(...))
if parent stream emits Resolved(...) and pf
is defined for it, do nothing otherwise
Attributes
Emit x
if parent stream emits Right(x)
, do nothing otherwise
Emit x
if parent stream emits Right(x)
, do nothing otherwise
Attributes
Emit pf(x)
if parent stream emits Right(x)
and pf
is defined for x
, do nothing otherwise
Emit pf(x)
if parent stream emits Right(x)
and pf
is defined for x
, do nothing otherwise
Attributes
Emit x
if parent stream emits Some(x)
, do nothing otherwise
Emit x
if parent stream emits Some(x)
, do nothing otherwise
Attributes
Emit pf(x)
if parent stream emits Some(x)
and pf
is defined for x
, do nothing otherwise
Emit pf(x)
if parent stream emits Some(x)
and pf
is defined for x
, do nothing otherwise
Attributes
Emit x
if parent stream emits Right(x)
, do nothing otherwise
Emit x
if parent stream emits Right(x)
, do nothing otherwise
Attributes
Emit pf(x)
if parent stream emits Success(x)
and pf
is defined for x
, do nothing otherwise
Emit pf(x)
if parent stream emits Success(x)
and pf
is defined for x
, do nothing otherwise
Attributes
Value parameters
- combinator
-
Must not throw!
Attributes
Value parameters
- combinator
-
Must not throw!
Attributes
Value parameters
- combinator
-
Must not throw!
Attributes
Value parameters
- combinator
-
Must not throw!
Attributes
Value parameters
- combinator
-
Must not throw!
Attributes
Value parameters
- combinator
-
Must not throw!
Attributes
Value parameters
- combinator
-
Must not throw!
Attributes
Value parameters
- combinator
-
Must not throw!
Attributes
Just a convenience helper. stream.compose(f) is equivalent to f(stream)
Just a convenience helper. stream.compose(f) is equivalent to f(stream)
Attributes
See docs for DebounceStream
See docs for DebounceStream
Attributes
See also various debug methods in com.raquo.airstream.debug.DebuggableObservable
See also various debug methods in com.raquo.airstream.debug.DebuggableObservable
Attributes
- Definition Classes
Value parameters
- ms
-
milliseconds of delay
Attributes
Make a stream that emits this stream's values but waits for after
stream to emit first in a given transaction. You can use this for Signals too with Signal.composeChanges
(see docs for more details)
Make a stream that emits this stream's values but waits for after
stream to emit first in a given transaction. You can use this for Signals too with Signal.composeChanges
(see docs for more details)
Attributes
Distinct all values (both events and errors) using a comparison function
Distinct all values (both events and errors) using a comparison function
Attributes
- Definition Classes
Drop (skip) the first numEvents
events from this stream. Note: errors are NOT dropped.
Drop (skip) the first numEvents
events from this stream. Note: errors are NOT dropped.
Value parameters
- resetOnStop
-
Reset the count if the stream stops
Attributes
Drop (skip) events from this stream as long as they do NOT pass the test (as soon as they start passing, stop dropping) Note: errors are NOT dropped.
Drop (skip) events from this stream as long as they do NOT pass the test (as soon as they start passing, stop dropping) Note: errors are NOT dropped.
Value parameters
- passes
-
Note: MUST NOT THROW!
- resetOnStop
-
Forget everything and start dropping again if the stream stops
Attributes
Drop (skip) events from this stream as long as they pass the test (as soon as they stop passing, stop dropping) Note: errors are NOT dropped.
Drop (skip) events from this stream as long as they pass the test (as soon as they stop passing, stop dropping) Note: errors are NOT dropped.
Value parameters
- passes
-
Note: MUST NOT THROW!
- resetOnStop
-
Forget everything and start dropping again if the stream stops
Attributes
Value parameters
- passes
-
Note: guarded against exceptions
Attributes
Filter stream events by a signal or var of boolean.
Filter stream events by a signal or var of boolean.
stream.filterWith(otherSignal, passes = _ == false)
is essentially like stream.filter(_ => otherSignal.now() == false)
(but it compiles)
Attributes
Filter stream events by a signal or var of boolean (passes when true).
Filter stream events by a signal or var of boolean (passes when true).
Attributes
Value parameters
- project
-
Note: guarded against exceptions
Attributes
- Definition Classes
Returns a stream that emits events from this stream AND all off the streams
, interleaved. Note: For other types of combination, see combineWith
, withCurrentValueOf
, sample
etc.
Returns a stream that emits events from this stream AND all off the streams
, interleaved. Note: For other types of combination, see combineWith
, withCurrentValueOf
, sample
etc.
Attributes
See docs for MapStream
See docs for MapStream
Value parameters
- pf
-
Note: guarded against exceptions
Attributes
- Definition Classes
Convert this to an observable that emits Left(err) instead of erroring
Convert this to an observable that emits Left(err) instead of erroring
Attributes
- Definition Classes
Convert this to an observable that emits Failure(err) instead of erroring
Convert this to an observable that emits Failure(err) instead of erroring
Attributes
- Definition Classes
A signal that emits the accumulated value every time that the parent stream emits.
A signal that emits the accumulated value every time that the parent stream emits.
See also: startWith
Value parameters
- fn
-
Note: guarded against exceptions
Attributes
A signal that emits the accumulated value every time that the parent stream emits.
A signal that emits the accumulated value every time that the parent stream emits.
Value parameters
- fn
-
Note: Must not throw!
Attributes
Split a stream of booleans.
Split a stream of booleans.
Value parameters
- falseF
-
called when the parent stream switches from
true
tofalse
. The provided signal emitsUnit
on everyfalse
event emitted by the stream. - trueF
-
called when the parent stream switches from
false
totrue
. The provided signal emitsUnit
on everytrue
event emitted by the stream.
Attributes
Like split
, but uses index of the item in the list as the key.
Like split
, but uses index of the item in the list as the key.
Attributes
This .split
-s a stream of Either-s by their isRight
property. If you want a different key, use the .splitOne operator directly.
This .split
-s a stream of Either-s by their isRight
property. If you want a different key, use the .splitOne operator directly.
Value parameters
- left
-
(initialLeft, signalOfLeftValues) => output
left
is called wheneverstream
switches fromRight()
toLeft()
.signalOfLeftValues
starts withinitialLeft
value, and updates when the parent stream updates fromLeft(a) to
Left(b)`. - right
-
(initialRight, signalOfRightValues) => output
right
is called wheneverstream
switches fromLeft()
toRight()
.signalOfRightValues
starts withinitialRight
value, and updates when the parent stream updates fromRight(a)
toRight(b)
.
Attributes
This operator works like split
, but with only one item, not a collection of items.
This operator works like split
, but with only one item, not a collection of items.
Attributes
This .split
-s a Stream of an Option by the Option's isDefined
property. If you want a different key, use the .split operator directly.
This .split
-s a Stream of an Option by the Option's isDefined
property. If you want a different key, use the .split operator directly.
Value parameters
- ifEmpty
-
- returned if Option is empty, or if the parent stream has not emitted any events yet. Re-evaluated whenever the parent
stream
switches fromSome(a)
toNone
.ifEmpty
is NOT re-evaluated when the parent stream emitsNone
if the last event it emitted was also aNone
.
- returned if Option is empty, or if the parent stream has not emitted any events yet. Re-evaluated whenever the parent
- project
-
- (initialInput, signalOfInput) => output
project
is called whenever the parent signal switches fromNone
toSome()
.signalOfInput
starts withinitialInput
value, and updates when the parent stream updates fromSome(a)
toSome(b)
.
- (initialInput, signalOfInput) => output
Attributes
This operator lets you "split" EventStream[Input] into two branches:
This operator lets you "split" EventStream[Input] into two branches:
- processing of Signal[Input] into Output, and
- the initial value of Output. This is a nice shorthand to to signal.splitOption in cases when signal is actually stream.toWeakSignal or stream.startWith(initial)
Attributes
This .split
-s a stream of Statuses by their type (resolved vs pending). If you want a different key, use the .splitOne operator directly.
This .split
-s a stream of Statuses by their type (resolved vs pending). If you want a different key, use the .splitOne operator directly.
Value parameters
- pending
-
(initialPending, signalOfPendingValues) => output
pending
is called wheneverstream
switches fromResolved
toPending
, or when the very first event is emitted (and it'sPending
, as is typical)signalOfPendingValues
starts withinitialPending
value, and updates when the parent stream emits a newResolved
consecutively after anotherResolved
. This happens when the stream emits inputs faster than the outputs are resolved. - resolved
-
(initialResolved, signalOfResolvedValues) => output
resolved
is called wheneverstream
switches fromPending
toResolved
.signalOfResolvedValues
starts withinitialResolved
value, and updates when the parent stream emits a newResolved
consecutively after anotherResolved
.
Attributes
This .split
-s a stream of Try-s by their isSuccess
property. If you want a different key, use the .splitOne operator directly.
This .split
-s a stream of Try-s by their isSuccess
property. If you want a different key, use the .splitOne operator directly.
Value parameters
- failure
-
(initialFailure, signalOfFailureValues) => output
failure
is called wheneverstream
switches fromSuccess()
toFailure()
.signalOfFailureValues
starts withinitialFailure
value, and updates when the parent stream updates fromFailure(a)
toFailure(b)
. - success
-
(initialSuccess, signalOfSuccessValues) => output
success
is called wheneverstream
switches fromFailure()
toSuccess()
.signalOfSuccessValues
starts withinitialSuccess
value, and updates when the parent stream updates fromSuccess(a)
toSuccess(b)
.
Attributes
Convert stream to signal, given an initial value
Convert stream to signal, given an initial value
Value parameters
- cacheInitialValue
-
if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)
Attributes
Value parameters
- cacheInitialValue
-
if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)
Attributes
Take the first numEvents
events from this stream, ignore the rest. Note: As long as events are being taken, ALL errors are also taken
Take the first numEvents
events from this stream, ignore the rest. Note: As long as events are being taken, ALL errors are also taken
Value parameters
- resetOnStop
-
Reset the count if the stream stops
Attributes
Imitate parent stream as long as events to NOT pass the test; stop emitting after that.
Imitate parent stream as long as events to NOT pass the test; stop emitting after that.
Value parameters
- passes
-
Note: MUST NOT THROW!
- resetOnStop
-
Forget everything and start dropping again if the stream stops
Attributes
Imitate parent stream as long as events pass the test; stop emitting after that.
Imitate parent stream as long as events pass the test; stop emitting after that.
Value parameters
- passes
-
Note: MUST NOT THROW!
- resetOnStop
-
Forget everything and start dropping again if the stream stops
Attributes
See docs for ThrottleStream
See docs for ThrottleStream
Attributes
Attributes
- Definition Classes
Value parameters
- cacheInitialValue
-
if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)
Attributes
Value parameters
- cacheInitialValue
-
if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)
Attributes
Value parameters
- cacheInitialValue
-
if false, signal's initial value will be re-evaluated on every restart (so long as the parent stream does not emit any values)
Attributes
Deprecated methods
Attributes
- Deprecated
- true
Inherited methods
Subscribe an external observer to this observable
Trigger JS debugger for emitted events and errors if when
passes Note: for Signals this also triggers onStart (with the current value at the time)
Trigger JS debugger for emitted events and errors if when
passes Note: for Signals this also triggers onStart (with the current value at the time)
Attributes
- Inherited from:
- DebuggableObservable
Trigger JS debugger for emitted errors (but not events) if when
passes Note: for Signals this also triggers onStart (if current value is an error)
Trigger JS debugger for emitted errors (but not events) if when
passes Note: for Signals this also triggers onStart (if current value is an error)
Attributes
- Inherited from:
- DebuggableObservable
Trigger JS debugger for emitted events (but not errors) if when
passes Note: for Signals this also triggers onStart (if current value is not an error)
Trigger JS debugger for emitted events (but not errors) if when
passes Note: for Signals this also triggers onStart (if current value is not an error)
Attributes
- Inherited from:
- DebuggableObservable
Trigger JS debugger when the observable starts and stops
Trigger JS debugger when the observable starts and stops
Attributes
- Inherited from:
- DebuggableObservable
Trigger JS debugger when the observable starts
Trigger JS debugger when the observable stops
Log emitted events and errors if when
condition passes, using dom.console.log if useJsLogger
is true. Note: for Signals this also triggers on start (with the current value at the time)
Log emitted events and errors if when
condition passes, using dom.console.log if useJsLogger
is true. Note: for Signals this also triggers on start (with the current value at the time)
Attributes
- Inherited from:
- DebuggableObservable
Log emitted errors (but not regular events) if when
condition passes Note: for Signals this also triggers onStart (if current value is an error)
Log emitted errors (but not regular events) if when
condition passes Note: for Signals this also triggers onStart (if current value is an error)
Attributes
- Inherited from:
- DebuggableObservable
Log emitted events (but not errors) if when
condition passes, using dom.console.log if useJsLogger
is true. Note: for Signals this also triggers onStart (if current value is not an error)
Log emitted events (but not errors) if when
condition passes, using dom.console.log if useJsLogger
is true. Note: for Signals this also triggers onStart (if current value is not an error)
Attributes
- Inherited from:
- DebuggableObservable
Log when the observable starts and stops
Log when the observable starts
Log when the observable stops
Execute fn on every emitted event or error Note: for Signals this also triggers onStart (with the current value at the time)
Execute fn on every emitted event or error Note: for Signals this also triggers onStart (with the current value at the time)
Attributes
- Inherited from:
- DebuggableObservable
Execute fn on every emitted error (but not regular events) Note: for Signals this also triggers onStart (if current value is an error)
Execute fn on every emitted error (but not regular events) Note: for Signals this also triggers onStart (if current value is an error)
Attributes
- Inherited from:
- DebuggableObservable
Execute fn on every emitted event (but not error) Note: for Signals this also triggers onStart (if current value is not an error)
Execute fn on every emitted event (but not error) Note: for Signals this also triggers onStart (if current value is not an error)
Attributes
- Inherited from:
- DebuggableObservable
Execute callbacks on when the observable starts and stops
Execute callbacks on when the observable starts and stops
Value parameters
- startFn
-
topoRank => ()
Attributes
- Inherited from:
- DebuggableObservable
Execute callbacks on when the observable starts
Execute callbacks on when the observable starts
Value parameters
- fn
-
topoRank => ()
Attributes
- Inherited from:
- DebuggableObservable
Execute callbacks on when the observable stops
Return the observable's topoRank. This does not affect the observable in any way.
Return the observable's topoRank. This does not affect the observable in any way.
Attributes
- Inherited from:
- DebuggableObservable
Create a new observable that listens to the original, and set the displayName of the new observable. This is different from setDisplayName
.
Create a new observable that listens to the original, and set the displayName of the new observable. This is different from setDisplayName
.
If you say stream.debugWithName("foo").debugLog()
, the displayName used by the logger will be "foo" verbatim, whereas if you say stream.setDisplayName("foo").debugLog()
, the logger's displayName will be "foo|Debug" – with a suffix – to differentiate it from the "foo" displayName of stream
itself.
Attributes
- Inherited from:
- DebuggableObservable
This is the method that subclasses override to preserve the user's ability to set custom display names.
This is the method that subclasses override to preserve the user's ability to set custom display names.
Attributes
- Inherited from:
- Named
Attributes
- Inherited from:
- Named
Distinct events (but keep all errors) by == (equals) comparison
Distinct events (but keep all errors) by == (equals) comparison
Attributes
- Inherited from:
- BaseObservable
Distinct events (but keep all errors) by matching key Note: key(event)
might be evaluated more than once for each event
Distinct events (but keep all errors) by matching key Note: key(event)
might be evaluated more than once for each event
Attributes
- Inherited from:
- BaseObservable
Distinct events (but keep all errors) using a comparison function
Distinct events (but keep all errors) using a comparison function
Attributes
- Inherited from:
- BaseObservable
Distinct events (but keep all errors) by reference equality (eq)
Distinct events (but keep all errors) by reference equality (eq)
Attributes
- Inherited from:
- BaseObservable
Distinct errors only (but keep all events) using a comparison function
Distinct errors only (but keep all events) using a comparison function
Attributes
- Inherited from:
- BaseObservable
Airstream may internally use Scala library functions which use ==
or hashCode
for equality, for example List.contains. Comparing observables by structural equality pretty much never makes sense, yet it's not that hard to run into that, all you need is to create a case class
subclass, and the Scala compiler will generate a structural-equality equals
and hashCode
methods for you behind the scenes.
Airstream may internally use Scala library functions which use ==
or hashCode
for equality, for example List.contains. Comparing observables by structural equality pretty much never makes sense, yet it's not that hard to run into that, all you need is to create a case class
subclass, and the Scala compiler will generate a structural-equality equals
and hashCode
methods for you behind the scenes.
To prevent that, we make equals and hashCode methods final, using the default implementation (which is reference equality).
Attributes
- Definition Classes
-
BaseObservable -> Any
- Inherited from:
- BaseObservable
#WARNING: DO NOT USE THIS METHOD. See https://github.com/raquo/Airstream/#flattening-observables
#WARNING: DO NOT USE THIS METHOD. See https://github.com/raquo/Airstream/#flattening-observables
Attributes
- Inherited from:
- BaseObservable
Alias to flatMapSwitch(_ => s)
Shorthand for flatMapWithStatus(_ => innerStream)
.
Based on flatMapSwitch, but tracks the status of input and output to flatMap. See Status.
Based on flatMapSwitch, but tracks the status of input and output to flatMap. See Status.
Attributes
- Inherited from:
- BaseObservable
Create an external observer from a function and subscribe it to this observable.
Create an external observer from a function and subscribe it to this observable.
Note: since you won't have a reference to the observer, you will need to call Subscription.kill() to unsubscribe
Attributes
- Inherited from:
- BaseObservable
Force reference equality checks. See comment for equals
.
Force reference equality checks. See comment for equals
.
Attributes
- Definition Classes
-
BaseObservable -> Any
- Inherited from:
- BaseObservable
value
is passed by name, so it will be evaluated whenever the Observable fires. Use it to sample mutable values (e.g. myInput.ref.value in Laminar).
value
is passed by name, so it will be evaluated whenever the Observable fires. Use it to sample mutable values (e.g. myInput.ref.value in Laminar).
See also: mapToStrict
Value parameters
- value
-
Note: guarded against exceptions
Attributes
- Inherited from:
- BaseObservable
value
is evaluated strictly, only once, when this method is called.
value
is evaluated strictly, only once, when this method is called.
See also: mapTo
Attributes
- Inherited from:
- BaseObservable
Attributes
- Inherited from:
- BaseObservable
Attributes
- Inherited from:
- BaseObservable
Attributes
- Inherited from:
- BaseObservable
Set the display name for this instance (observable or observer).
Set the display name for this instance (observable or observer).
- This method modifies the instance and returns
this
. It does not create a new instance. - New name you set will override the previous name, if any. This might change in the future. For the sake of sanity, don't call this more than once for the same instance.
- If display name is set, toString will output it instead of the standard type@hashcode string
Attributes
- Inherited from:
- Named
Execute a side effecting callback every time the observable emits. If it's a signal, it also runs when its initial value is evaluated.
Execute a side effecting callback every time the observable emits. If it's a signal, it also runs when its initial value is evaluated.
See https://github.com/raquo/Airstream/#tapEach for more details.
Attributes
- Inherited from:
- BaseObservable
Attributes
- Inherited from:
- BaseObservable
Attributes
- Inherited from:
- BaseObservable
Override defaultDisplayName instead of this, if you need to.
Override defaultDisplayName instead of this, if you need to.
Attributes
Convert this observable to a signal of Option[A]. If it is a stream, set initial value to None.
Convert this observable to a signal of Option[A]. If it is a stream, set initial value to None.
Attributes
- Inherited from:
- BaseObservable