DerivativeBase

japgolly.scalajs.react.extra.Px$.DerivativeBase
sealed abstract class DerivativeBase[A, B, C](xa: Px[A], derive: A => B) extends Derivative[C]

Attributes

Graph
Supertypes
class Derivative[C]
class Px[C]
class Object
trait Matchable
class Any
Known subtypes
class FlatMap[A, B]
class Map[A, B]

Members list

Type members

Types

protected type ValRev = (B, Int)

Value members

Concrete methods

final protected def _init(): ValRev
final protected def _revA(): Int
final protected def _updateValueIfChanged(): Unit
final protected def _value(): B

Inherited methods

def extract(implicit e: Extract[C]): A

If this Px contains a function, it can be extracted and the Px dropped from the signature. Every time the function is invoked it will use the latest value of this Px, even if you don't explicitly hold a reference to it anymore.

If this Px contains a function, it can be extracted and the Px dropped from the signature. Every time the function is invoked it will use the latest value of this Px, even if you don't explicitly hold a reference to it anymore.

Example. From a Px[Int => String], an Int => String can be extracted.

Attributes

Inherited from:
Px
def flatMap[B](f: C => Px[B]): Derivative[B]

Attributes

Inherited from:
Px
def map[B](f: C => B): Derivative[B]

Attributes

Inherited from:
Px
def peek: A

Get the last used value without updating.

Get the last used value without updating.

Attributes

Inherited from:
Px
def rev: Int

Revision of its value. Increments when value changes.

Revision of its value. Increments when value changes.

Attributes

Inherited from:
Px
final def toCallback[F[_]](implicit F: Sync[F]): F[A]

Attributes

Inherited from:
Px
def value(): A

Get the latest value, updating itself if necessary.

Get the latest value, updating itself if necessary.

Attributes

Inherited from:
Px
final def valueSince(r: Int): Option[A]

Attributes

Inherited from:
Px
final def withReuse(implicit ev: Reusability[C]): Px[A]

In addition to updating when the underlying Px changes, this will also check its own result and halt updates if reusable.

In addition to updating when the underlying Px changes, this will also check its own result and halt updates if reusable.

Attributes

Inherited from:
Derivative