Type Alias TFetchFactory<DATA_TYPE, RETURN_DATA_TYPE>

TFetchFactory<DATA_TYPE, RETURN_DATA_TYPE>: ((endpoint: string, data?: DATA_TYPE) => Promise<RETURN_DATA_TYPE>)

A type definition for a factory function that creates fetch operations

Type Parameters

  • DATA_TYPE

    The type of data being sent in the request

  • RETURN_DATA_TYPE

    The type of data expected in the response

Type declaration

    • (endpoint, data?): Promise<RETURN_DATA_TYPE>
    • Parameters

      • endpoint: string

        The URL endpoint for the fetch operation

      • Optionaldata: DATA_TYPE

        Optional data to be sent with the request

      Returns Promise<RETURN_DATA_TYPE>

      A Promise that resolves with the response data of type RETURN_DATA_TYPE