Reactive

reactify.Reactive
See theReactive companion object
trait Reactive[T]

Reactive is the core trait for Reactify. The basic premise is that a Reactive represents an instance that can attach Reactions and fire T and are received by those Reactions.

Type parameters

T

the type of value this Reactive receives

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Channel[T]
class ChannelGroup[T]
class Trigger
class Dep[T, R]
trait Stateful[T]
class StatefulGroup[T]
class Val[T]
class ValGroup[T]
class Var[T]
class VarGroup[T]
Show all

Members list

Value members

Concrete methods

def attach(f: T => Unit, priority: Double): Reaction[T]

Convenience method to create a Reaction to attach to this Reactive

Convenience method to create a Reaction to attach to this Reactive

Value parameters

f

the function reaction

priority

the priority in comparison to other reactions (Defaults to Priority.Normal)

Attributes

Returns

created Reaction[T]

def changes(f: (T, T) => Unit, priority: Double): Reaction[T]

Convenience method to create a Reaction to monitor changes to this Reactive

Convenience method to create a Reaction to monitor changes to this Reactive

Value parameters

f

the function reaction to receive changes

priority

the priority in comparison to other reactions (Defaults to Priority.Normal)

Attributes

Returns

created Reaction[T]

def future(condition: T => Boolean): Future[T]

Convenience method to create a Future[T] that will complete upon the next reaction that meets to supplied condition.

Convenience method to create a Future[T] that will complete upon the next reaction that meets to supplied condition.

Value parameters

condition

optional condition that must be true for this to fire (Defaults to accept anything)

Attributes

Returns

Future[T]

def on(f: => Unit, priority: Double): Reaction[T]

Convenience method to create a Reaction to monitor changes to this Reactive when you don't care about the actual value.

Convenience method to create a Reaction to monitor changes to this Reactive when you don't care about the actual value.

Value parameters

f

the function reaction to invoke in reaction to a value received

priority

the priority in comparison to other reactions (Defaults to Priority.Normal)

Attributes

Returns

created Reaction[T]

def once(f: T => Unit, condition: T => Boolean, priority: Double): Reaction[T]

Convenience method to create a Reaction to monitor a single reaction based on an optional condition.

Convenience method to create a Reaction to monitor a single reaction based on an optional condition.

Value parameters

condition

optional condition that must be true for this to fire (Defaults to accept anything)

f

the function reaction

priority

the priority in comparison to other reactions (Defaults to Priority.Normal)

Attributes

Returns

created Reaction[T]

def status: Option[ReactionStatus]

If the current thread is reacting to a value currently, status represents the status of the reaction. This can be set to ReactionStatus.Stop in order to stop propagation. This can also be achieved via stopPropagation().

If the current thread is reacting to a value currently, status represents the status of the reaction. This can be set to ReactionStatus.Stop in order to stop propagation. This can also be achieved via stopPropagation().

Attributes

def status_=(status: ReactionStatus): Unit
def stopPropagation(): Unit

Shortcut functionality to call status = ReactionStatus.Stop

Shortcut functionality to call status = ReactionStatus.Stop

Attributes

Concrete fields

lazy val reactions: Reactions[T]

Reactions currently associated with this Reactive

Reactions currently associated with this Reactive

Attributes