Class/Object

japgolly.scalajs.react

Reusability

Related Docs: object Reusability | package react

Permalink

final class Reusability[A] extends AnyVal

Tests whether one instance can be used in place of another. Used mostly to compare properties and state of a component to avoid unnecessary updates.

If you imagine a class with 8 fields, equality would compare all 8 fields where as this would typically just compare the ID field, the update-date, or the revision number. You might think of this as a very quick version of equality.

Don't miss Reusability.shouldComponentUpdate which can be applied to a component via ScalaComponent.build#configure.

Since

0.9.0

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Reusability
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Reusability(test: (A, A) ⇒ Boolean)

    Permalink

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. def &&[B <: A](tryNext: Reusability[B]): Reusability[B]

    Permalink
  4. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def contramap[B](f: (B) ⇒ A): Reusability[B]

    Permalink
  7. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  8. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  9. def logNonReusable(show: (A) ⇒ String = _.toString, log: (String) ⇒ Unit = console.warn(_), title: String = "Non-reusability:", fmt: (String, ⇒ String, ⇒ String) ⇒ String = (t, x, y) => s"$t\n- $x\n- $y"): Reusability[A]

    Permalink
  10. def logNonReusable: Reusability[A]

    Permalink
  11. def narrow[B <: A]: Reusability[B]

    Permalink
  12. def reusable(a: A)(implicit c: ClassTag[A]): Reusable[A]

    Permalink
  13. val test: (A, A) ⇒ Boolean

    Permalink
  14. def testNot: (A, A) ⇒ Boolean

    Permalink
  15. def toString(): String

    Permalink
    Definition Classes
    Any
  16. def ||[B <: A](tryNext: Reusability[B]): Reusability[B]

    Permalink

Inherited from AnyVal

Inherited from Any

Ungrouped