StateProvider is a component that manages the state of an object and provides it to its children components through a context. It takes in various props to configure its behavior.

  • Type Parameters

    • Data extends unknown

      The type of the object being managed by the StateProvider.

    • Payload extends unknown

      The type of the payload used for fetching the object.

    • Field extends IField<Data, Payload> = IField<Data, Payload>

      The type of the field used for validating the object.

    Parameters

    • props: IStateProviderProps<Data, Payload, Field>

      The props used to configure the StateProvider.

      • children

        The children components to be rendered within the StateProvider.

      • fields

        The fields used for validating the object.

      • features

        The features used for manipulating the object.

      • change

        The function called when the object is changed.

      • fallback

        The function called when the object cannot be resolved.

      • handler

        The function used for fetching the object.

      • payload

        The payload used for fetching the object.

      • loadStart

        The function called when the object starts loading.

      • loadEnd

        The function called when the object finishes loading.

    Returns Element