Sub

tyrian.Sub
See theSub companion trait
object Sub

Attributes

Companion
trait
Graph
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Sub.type

Members list

Type members

Classlikes

final case class Batch[F[_], Msg](subs: List[Sub[F, Msg]]) extends Sub[F, Msg]

Treat many subscriptions as one

Treat many subscriptions as one

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Sub[F, Msg]
class Object
trait Matchable
class Any
Show all
object Batch

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Batch.type
final case class Combine[F[_], Msg](sub1: Sub[F, Msg], sub2: Sub[F, Msg]) extends Sub[F, Msg]

Merge two subscriptions into a single one

Merge two subscriptions into a single one

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
trait Sub[F, Msg]
class Object
trait Matchable
class Any
Show all
case object None extends Sub[Nothing, Nothing]

The empty subscription represents the absence of subscriptions

The empty subscription represents the absence of subscriptions

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
trait Sub[Nothing, Nothing]
class Object
trait Matchable
class Any
Show all
Self type
None.type
final case class Observe[F[_], A, Msg](id: String, observable: F[(Either[Throwable, A] => Unit) => F[Option[F[Unit]]]], toMsg: A => Option[Msg]) extends Sub[F, Msg]

A subscription that forwards the notifications produced by the given observable

A subscription that forwards the notifications produced by the given observable

Type parameters

A

type of notification values produced by the observable

F

type of the effect monad, must be a Cats Effect 3 Concurrent.

Msg

type of message produced by the subscription

Value parameters

id

Globally unique identifier for this subscription

observable

Observable and cancellable/closable effect that produces notifications. Encoded as a callback with an effect describing how to optionally close the subscription.

toMsg

a function that turns every notification value into a possible message

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
trait Sub[F, Msg]
class Object
trait Matchable
class Any
Show all
object Observe

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Observe.type

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def animationFrameTick[F[_] : Async, Msg](id: String)(toMsg: Double => Msg): Sub[F, Msg]

A subscription that emits a msg based on the running time in seconds whenever the browser renders an animation frame.

A subscription that emits a msg based on the running time in seconds whenever the browser renders an animation frame.

Attributes

def combineAll[F[_], A](list: List[Sub[F, A]]): Sub[F, A]
def emit[F[_] : Sync, Msg](msg: Msg): Sub[F, Msg]

A subscription that emits a msg once. Identical to timeout with a duration of 0.

A subscription that emits a msg once. Identical to timeout with a duration of 0.

Attributes

def every[F[_] : Sync](interval: FiniteDuration, id: String): Sub[F, Date]

A subscription that repeatedly produces a msg based on an interval.

A subscription that repeatedly produces a msg based on an interval.

Attributes

def every[F[_] : Sync](interval: FiniteDuration): Sub[F, Date]

A subscription that repeatedly produces a msg based on an interval.

A subscription that repeatedly produces a msg based on an interval.

Attributes

def forever[F[_] : Sync, A, Msg](acquire: (Either[Throwable, A] => Unit) => Unit)(toMsg: A => Option[Msg]): Sub[F, Msg]

Make an uncancelable subscription that produces am optional message

Make an uncancelable subscription that produces am optional message

Attributes

def fromEvent[F[_] : Sync, A, Msg](name: String, target: EventTarget)(extract: A => Option[Msg]): Sub[F, Msg]

A subscription that emits a msg based on an a JavaScript event.

A subscription that emits a msg based on an a JavaScript event.

Attributes

def make[F[_] : Sync, A, Msg, R](id: String)(acquire: (Either[Throwable, A] => Unit) => F[R])(release: R => F[Unit])(toMsg: A => Option[Msg]): Sub[F, Msg]

Make a cancelable subscription that produces an optional message

Make a cancelable subscription that produces an optional message

Attributes

def make[F[_] : Sync, A, R](id: String)(acquire: (Either[Throwable, A] => Unit) => F[R])(release: R => F[Unit]): Sub[F, A]

Make a cancelable subscription that returns a value (to be mapped into a Msg)

Make a cancelable subscription that returns a value (to be mapped into a Msg)

Attributes

def make[F[_] : Async, A](id: String, stream: Stream[F, A]): Sub[F, A]

Make a subscription based on an fs2.Stream. The stream is cancelled when it it removed from the list of subscriptions.

Make a subscription based on an fs2.Stream. The stream is cancelled when it it removed from the list of subscriptions.

Attributes

def make[F[_] : Async, A](id: String)(stream: Stream[F, A])(cleanUp: F[Unit]): Sub[F, A]

Make a subscription based on an fs2.Stream with additional custom clean up. The stream itself is always cancelled when it it removed from the list of subscriptions, even if no particular clean up is defined.

Make a subscription based on an fs2.Stream with additional custom clean up. The stream itself is always cancelled when it it removed from the list of subscriptions, even if no particular clean up is defined.

Attributes

final def merge[F[_], Msg, LubMsg >: Msg](a: Sub[F, Msg], b: Sub[F, LubMsg]): Sub[F, LubMsg]
def timeout[F[_] : Sync, Msg](duration: FiniteDuration, msg: Msg, id: String): Sub[F, Msg]

A subscription that produces a msg after a duration.

A subscription that produces a msg after a duration.

Attributes

def timeout[F[_] : Sync, Msg](duration: FiniteDuration, msg: Msg): Sub[F, Msg]

A subscription that produces a msg after a duration.

A subscription that produces a msg after a duration.

Attributes

Givens

Givens

given given_CanEqual_Option_Option: CanEqual[Option[_], Option[_]]
given given_CanEqual_Sub_Sub: CanEqual[Sub[_[_], _], Sub[_[_], _]]
given given_Eq_Sub[F[_], Msg : Eq]: given_Eq_Sub[F, Msg]
given given_Functor_Sub[F[_]]: given_Functor_Sub[F]
given given_Monoid_Sub[F[_], Msg]: given_Monoid_Sub[F, Msg]