Skip to main content

Fetch Release

fetches orders of an account.

Import fetchRelease with const { fetchRelease } = MetastaqInstance and call it as described below to get the required data.

fetchPendingOrders
import React from "react";
import { MetastaqInstance } from "./MetastaqInstance";

export const ShowReleaseData = () => {
const { fetchRelease } = MetastaqInstance;

const { status, data, error, isFetching, isLoading, refetch } =
fetchRelease();

return (
<button
onClick={() => {
refetch();
}}
>
refetch Release Data
</button>
);
};

The fetchRelease method returns status, data, error, isFetching, isLoading, refetch, where data is the required data, status tells you the success or failure status of the response, error tells you the error message, isFetching and isLoading are Boolean values that tell you the status, whether the request is still running or not, and the refetch method lets you retrieve the response again if you want to update the status when you click the button.