final
class
Reusability[A] extends AnyVal
Instance Constructors
-
new
Reusability(test: (A, A) ⇒ Boolean)
Value Members
-
final
def
!=(arg0: Any): Boolean
-
final
def
##(): Int
-
-
final
def
==(arg0: Any): Boolean
-
final
def
asInstanceOf[T0]: T0
-
def
contramap[B](f: (B) ⇒ A): Reusability[B]
-
def
getClass(): Class[_ <: AnyVal]
-
final
def
isInstanceOf[T0]: Boolean
-
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
-
Inherited from AnyVal
Inherited from Any
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 viaScalaComponent.build#configure
.0.9.0