Signal is an Observable with a current value.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait SignalSource[A]trait Observable[A]trait Namedtrait Source[A]class Objecttrait Matchableclass AnyShow all
- Known subtypes
-
trait WritableSignal[A]class DebuggerSignal[A]class DistinctSignal[A]class ObservedSignal[A]class SignalFromStream[A]class CustomSignalSource[A]class SwitchSignal[A]class Val[A]class JsPromiseSignal[A]trait StrictSignal[A]trait OwnedSignal[A]Show all
Members list
Value members
Concrete methods
A stream of all values in this signal, excluding the initial value.
A stream of all values in this signal, excluding the initial value.
When re-starting this stream, it emits the signal's new current value if and only if something has caused the signal's value to be updated or re-evaluated while the changes stream was stopped. This way the changes stream stays in sync with the signal even after restarting.
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
Value parameters
- operator
-
Note: Must not throw!
Attributes
Value parameters
- changesOperator
-
Note: Must not throw!
- initialOperator
-
Note: Must not throw!
Attributes
Value parameters
- operator
-
Note: Must not throw!
Attributes
Trigger JS debugger when signal is evaluating its initial value (if when
passes at that time)
Trigger JS debugger when signal is evaluating its initial value (if when
passes at that time)
Attributes
Log when signal is evaluating its initial value (if when
passes at that time)
Log when signal is evaluating its initial value (if when
passes at that time)
Attributes
Execute fn when signal is evaluating its currentValueFromParent
. This is typically triggered when evaluating signal's initial value onStart, as well as on subsequent re-starts when the signal is syncing its value to the parent's new current value.
Execute fn when signal is evaluating its currentValueFromParent
. This is typically triggered when evaluating signal's initial value onStart, as well as on subsequent re-starts when the signal is syncing its value to the parent's new current value.
Attributes
See also debug methods in com.raquo.airstream.debug.DebuggableObservable
See also debug methods in com.raquo.airstream.debug.DebuggableObservable
Attributes
- Definition Classes
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
Value parameters
- project
-
Note: guarded against exceptions
Attributes
- Definition Classes
Add a noop observer to this signal to ensure that it's started. This lets you access .now and .tryNow on the resulting StrictSignal.
Add a noop observer to this signal to ensure that it's started. This lets you access .now and .tryNow on the resulting StrictSignal.
You can use myStream.toWeakSignal.observe.tryNow()
to read the last emitted value from event streams just as well.
Attributes
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 signal emits.
A signal that emits the accumulated value every time that the parent signal emits.
Value parameters
- fn
-
Note: guarded against exceptions
- makeInitial
-
Note: guarded against exceptions
Attributes
A signal that emits the accumulated value every time that the parent signal emits.
A signal that emits the accumulated value every time that the parent signal emits.
Value parameters
- fn
-
(currentValue, nextParentValue) => nextValue
- makeInitial
-
currentParentValue => initialValue Note: must not throw
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 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 Signal of an Option by the Option's isDefined
property. If you want a different key, use the .split operator directly.
This .split
-s a Signal 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. Evaluated whenever the parent
signal
switches fromSome(a)
toNone
, or when the parent signal starts with aNone
.ifEmpty
is NOT re-evaluated when the parent signal emitsNone
if its value is alreadyNone
.
- returned if Option is empty. Evaluated whenever the parent
- project
-
- (initialInput, signalOfInput) => output
project
is called whenever signal switches fromNone
toSome()
.signalOfInput
starts withinitialInput
value, and updates when the parentsignal
updates fromSome(a)
toSome(b)
.
- (initialInput, signalOfInput) => output
Attributes
Attributes
- Definition Classes
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
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
Unwrap Try to "undo" recoverToTry
– Encode Failure(err) as observable errors, and Success(v) as events
Unwrap Try to "undo" recoverToTry
– Encode Failure(err) as observable errors, and Success(v) as events
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