Sub

object Sub
Companion:
class
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Sub.type

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

Companion:
object
object Batch
Companion:
class
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

case object None extends Sub[Nothing, Nothing]

The empty subscription represents the absence of subscriptions

The empty subscription represents the absence of subscriptions

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

Companion:
object
object Observe
Companion:
class

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Inherited from:
Mirror

The name of the type

The name of the type

Inherited from:
Mirror

Value members

Concrete methods

def animationFrameTick[F[_] : Sync, 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.

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.

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.

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.

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

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.

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

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)

def make[F[_] : Async, A](id: String, stream: Stream[F, A]): Sub[F, A]
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.

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.

Givens

Givens

given given_CanEqual_Sub_Sub: CanEqual[Sub[_[_], _], Sub[_[_], _]]
given given_Monoid_Sub[F[_], Msg]: Monoid[Sub[F, Msg]]