Map

japgolly.scalajs.react.extra.Px$.Map
final class Map[A, B](xa: Px[A], f: A => B) extends DerivativeBase[A, B, B]

A value B dependent on the value of some Px[A].

Attributes

Graph
Supertypes
class DerivativeBase[A, B, B]
class Derivative[B]
class Px[B]
class Object
trait Matchable
class Any
Show all

Members list

Type members

Inherited types

protected type ValRev = (B, Int)

Attributes

Inherited from:
DerivativeBase

Value members

Concrete methods

override def flatMap[C](g: B => Px[C]): Derivative[C]

Attributes

Definition Classes
Px
override def map[C](g: B => C): Derivative[C]

Attributes

Definition Classes
Px
override def peek: B

Get the last used value without updating.

Get the last used value without updating.

Attributes

Definition Classes
Px
override def rev: Int

Revision of its value. Increments when value changes.

Revision of its value. Increments when value changes.

Attributes

Definition Classes
Px
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Any
override def value(): B

Get the latest value, updating itself if necessary.

Get the latest value, updating itself if necessary.

Attributes

Definition Classes
Px

Inherited methods

final protected def _init(): ValRev

Attributes

Inherited from:
DerivativeBase
final protected def _revA(): Int

Attributes

Inherited from:
DerivativeBase
final protected def _updateValueIfChanged(): Unit

Attributes

Inherited from:
DerivativeBase
final protected def _value(): B

Attributes

Inherited from:
DerivativeBase
def extract(implicit e: Extract[B]): 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
final def toCallback[F[_]](implicit F: Sync[F]): F[A]

Attributes

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

Attributes

Inherited from:
Px
final def withReuse(implicit ev: Reusability[B]): 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