Request Function

Code

const [data, state, request] = useApi(config, options)

// request the API data again
request(config?: ReactUseApi.Config, keepState = false)

Request Arguments

A function allows requesting API data again. This function will trigger re-render.

Name

Type

Default

Description

config

ReactUseApi.Config

The config passed from useApi()

An axios' config object to fetch API data.

keepState

boolean

false

Set to true to maintain current state data, which facilitates combining previous data with current data, such as table list data.

Last updated