Hooks
RPS SDK comes with powerful hooks to make accessing RPS data simple and efficient.
Our hooks are built on top of SWR, a high-performance, lightweight data-fetching library. By utilizing SWR, you gain access to efficient request caching, request batching, and a host of robust features developed and tested by the SWR team. This means you can seamlessly incorporate these hooks into your components without concerns about performance bottlenecks or duplicate network requests. Moreover, you have the flexibility to customize SWR's configuration options for each of these SWR-powered hooks. Below, we outline the key properties returned by each of these hooks:
response: This property contains the response obtained from the API.
data: You can access the data extracted from the API response through this property.
mutate: We expose SWR's
mutate
function, enabling you to efficiently refresh the data when needed.error: If there is an issue or error with the API request, you will find the details here.
isValidating: This property allows you to check if there is an ongoing request or revalidation process.
Last updated