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
Ordering
- Alphabetic
- By Inheritance
Inherited
- AsyncComponent
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- sealed trait DataState[T] extends Product with Serializable
- 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
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def component[D]: FunctionalComponent[Props[D]]
- D
The data to fetch and render
- returns
the component
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- object DataState extends Serializable