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
Ordering
- Alphabetic
- By Inheritance
Inherited
- Reusability
- AnyVal
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new Reusability(test: (A, A) => Boolean)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- def &&[B <: A](tryNext: Reusability[B]): Reusability[B]
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def contramap[B](f: (B) => A): Reusability[B]
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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]
- def logNonReusable: Reusability[A]
- def narrow[B <: A]: Reusability[B]
- def reusable(a: A)(implicit c: ClassTag[A]): Reusable[A]
- val test: (A, A) => Boolean
- def testNot: (A, A) => Boolean
- def toString(): String
- Definition Classes
- Any
- def unsafeSubst[B]: Reusability[B]
- def unsafeWiden[B >: A]: Reusability[B]
- def updateNeeded(x: A, y: A): Boolean
- Annotations
- @inline()
- def ||[B <: A](tryNext: Reusability[B]): Reusability[B]