Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 2.04 KB

1.7.1.md

File metadata and controls

39 lines (30 loc) · 2.04 KB

1.7.1

  • Add AsyncCallback.barrier which returns:

    final case class Barrier(waitForCompletion: AsyncCallback[Unit], complete: Callback)
  • Deprecate getDerivedStateFromProps as step 2 (i.e. before .render) as it doesn't just get called when props change, it gets called when state changes too; meaning it gets reset every time you call setState (!). Use getDerivedStateFromPropsAndState instead.

  • Reusability

    • Add Reusability.disableGloballyInDev() to globally disable Reusability in fastOptJS
    • Add an implicit Reusability instance for ArraySeq (Scala 2.13 only)
    • Add instances for everything in java.time and scala.concurrent.duration.
      • If the data type contains a time, then you can either:
        • specify a tolerance and create your own implicit instance (eg. Reusability.finiteDuration(1 second))
        • import Reusability.TemporalImplicitsWithoutTolerance._
      • If the data type doesn't contain a time, then it's implicitly available out-of-the-box
    • Reusability.derive can now generate instances for recursive data types
    • Add Reusability.byName[A](f: => Reusability[A]): Reusability[A] which re-evaluates its argument on each invocation
  • StateSnapshot

    • Bugfix: remove all zoom-with-reuse methods from StateSnapshot instances; they don't work! This now means that there's only one way to zoom-with-reuse which is from the StateSnapshot object, and it's nice to have just one, uniform way of doing this. If you don't understand what this means have a look at the updated example: https://japgolly.github.io/scalajs-react/#examples/state-snapshot-2
    • Add StateSnapshot.withReuse.prepareViaProps
    • Add StateSnapshot.withReuse.prepareViaCallback
  • Add code: String to SimEvent.Keyboard

  • Add async variants to all of the MonocleReact extensions

    (Example: $.modStateAsyncL(State.someLens)(f): AsyncCallback[Unit])

  • Add an optional field to TriStateCheckbox props: disabled: Boolean which, when true, renders a disabled checkbox that is read-only.