Packages

object AsyncComponent

A reusable component to renders data from a asynchronous data source, providing:

  • A progress indicator when the data is being retrieved.
  • Invoking the render function when the data is available, to render such data.
  • Displaying an error message when retrieving the data has failed, as well as displaying a retry button so that the user is able to try again.
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AsyncComponent
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. sealed trait DataState[T] extends Product with Serializable
  2. case class Props[D](fetch: () => Future[D], render: (D) => ReactElement, onDataLoaded: (D) => Unit = (_: D) => (), progressIndicator: () => ReactElement = () => loader, progressIndicatorWhileReloadingData: Boolean = false, retryLabel: String = "Retry", watchedObjects: Iterable[Any] = List("")) extends Product with Serializable

    fetch

    the function to fetch the data

    render

    the function to render the data once it is available

    onDataLoaded

    a function invoked when the remote data has been loaded

    progressIndicator

    the component rendered when the data is being loaded

    progressIndicatorWhileReloadingData

    whether to display the progress indicator every time the data is being reloaded

    retryLabel

    the label to use in the button that retries the operation

    watchedObjects

    objects being watched, when any of those changes, the data is loaded again

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def component[D]: FunctionalComponent[Props[D]]

    D

    The data to fetch and render

    returns

    the component

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  10. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  17. def toString(): String
    Definition Classes
    AnyRef → Any
  18. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  20. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  21. object DataState extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped