We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2a5e976 commit 79bbaa1Copy full SHA for 79bbaa1
application/src/hooks/use-mollie-connector/use-mollie-connector.ts
@@ -79,17 +79,19 @@ const getMethods = async (targetUrl?: string) => {
79
80
export const usePaymentMethodsFetcher = (url: string | undefined) => {
81
const [fetchedData, setFetchedData] = useState<CustomMethodObject[]>([]);
82
+ const [fetchedDataLoading, setFetchedDataLoading] = useState<boolean>(true);
83
84
useEffect(() => {
85
const fetchData = async () => {
86
const data = (await getMethods(url)) ?? [];
87
setFetchedData(data);
88
+ setFetchedDataLoading(false);
89
};
90
91
if (url) {
92
fetchData();
93
}
94
}, [url]);
95
- return fetchedData;
96
+ return { fetchedData, fetchedDataLoading };
97
0 commit comments