Options
All
  • Public
  • Public/Protected
  • All
Menu

loadio

Index

Type aliases

PoolManagerSubscribeCallback

PoolManagerSubscribeCallback: (status: PoolCallbackParams) => void

Type declaration

PoolSubscribeCallback

PoolSubscribeCallback: (status: PoolCallbackParams) => void

Type declaration

WithStatusSettings

WithStatusSettings: { poolKey?: string | string[] }

Type declaration

  • Optional poolKey?: string | string[]

    Unique pool key. Use poolKey single or as an array. All loading statuses will store in the 'statusList' array with pool key except 'default' pool. Default value is 'default'

Functions

useStatus

  • Returns information about the target pool with hook

    Parameters

    • poolKey: string = "default"

      Unique pool key. Default value is 'default'

    Returns PoolCallbackParams

    Pool status

withPool

  • withPool<T>(method: T, poolKey?: string): T
  • Wraps the Promise method and notifies the target pool depend by key

    Type parameters

    • T: (...params: any) => Promise<any>

    Parameters

    • method: T

      The promise method desired to wrap (fetch, etc...)

    • poolKey: string = "default"

      Unique pool key. Default value is 'default'

    Returns T

    Wrapped method

withStatus

  • withStatus<T>(component: React.ComponentType<T>, settings?: WithStatusSettings): ForwardRefExoticComponent<RefAttributes<T>>
  • React component wrapper. Props of the wrapped component are automatically updated according to the state of the target pool or pools.

    Type parameters

    Parameters

    • component: React.ComponentType<T>

      The component which you want to wrap it

    • Optional settings: WithStatusSettings

      Settings

    Returns ForwardRefExoticComponent<RefAttributes<T>>

    Wrapped component

Generated using TypeDoc