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. Protected

Instance Constructors

  1. new Reusability(test: (A, A) => Boolean)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. def &&[B <: A](tryNext: Reusability[B]): Reusability[B]
  4. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def contramap[B](f: (B) => A): Reusability[B]
  7. def getClass(): Class[_ <: AnyVal]
    Definition Classes
    AnyVal → Any
  8. final def isInstanceOf[T0]: Boolean
    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]
  10. def logNonReusable: Reusability[A]
  11. def narrow[B <: A]: Reusability[B]
  12. def reusable(a: A)(implicit c: ClassTag[A]): Reusable[A]
  13. val test: (A, A) => Boolean
  14. def testNot: (A, A) => Boolean
  15. def toString(): String
    Definition Classes
    Any
  16. def unsafeSubst[B]: Reusability[B]
  17. def unsafeWiden[B >: A]: Reusability[B]
  18. def updateNeeded(x: A, y: A): Boolean
    Annotations
    @inline()
  19. def ||[B <: A](tryNext: Reusability[B]): Reusability[B]

Inherited from AnyVal

Inherited from Any

Ungrouped