Interface ReactivityProvider

All Known Implementing Classes:
Frame, FunctionComposable, Modal.ModalFrame, PageFrame, PaginatedFrame, ParamFrame, ParamPaginatedFrame, SimpleFrame

public interface ReactivityProvider
ReactivityProvider is an interface that provides access to some utility hooks
  • Method Summary

    Modifier and Type
    Method
    Description
    default <V> ReactiveState<V>
    useBoundState(V initial)
    Constructs a new ReactiveState bound to this object
    **Experimental**: This is an experimental hook, and it may change or be removed in the future
    default <I, O> org.apache.commons.lang3.concurrent.Computable<I,O>
    useMemo(@NotNull ReactiveState<I> dependency, @NotNull org.apache.commons.lang3.concurrent.Computable<I,O> computable)
    Memoizes a Computable, so it is only recalculated on state change.
    useState(V initial)
    Constructs a new ReactiveState
    default <V> ReactiveState<V>
    useUnboundState(V initial)
    Constructs a new ReactiveState that is **explicitly** not bound to this object
  • Method Details

    • useState

      <V> ReactiveState<V> useState(@Nullable V initial)
      Constructs a new ReactiveState
      Type Parameters:
      V - Type of the value inside state
      Parameters:
      initial - Initial value of the state
      Returns:
      A new ReactiveState
    • useBoundState

      @Experimental default <V> ReactiveState<V> useBoundState(@Nullable V initial)
      Constructs a new ReactiveState bound to this object
      **Experimental**: This is an experimental hook, and it may change or be removed in the future
      Type Parameters:
      V - Type of the value inside state
      Parameters:
      initial - Initial value of the state
      Returns:
      A new ReactiveState
    • useUnboundState

      default <V> ReactiveState<V> useUnboundState(@Nullable V initial)
      Constructs a new ReactiveState that is **explicitly** not bound to this object
      Type Parameters:
      V - Type of the value inside state
      Parameters:
      initial - Initial value of the state
      Returns:
      A new ReactiveState
    • useMemo

      default <I, O> org.apache.commons.lang3.concurrent.Computable<I,O> useMemo(@NotNull @NotNull ReactiveState<I> dependency, @NotNull @NotNull org.apache.commons.lang3.concurrent.Computable<I,O> computable)
      Memoizes a Computable, so it is only recalculated on state change.
      Type Parameters:
      I - Type of value inside dependency
      O - Type of output value
      Parameters:
      dependency - Dependency to watch for changes
      computable - Computable to memoize
      Returns:
      A memoized computable