UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

32 lines (31 loc) 870 B
import { useFetch as m } from "./useFetch.js"; import { useMemo as F } from "../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js"; import { useStores as f } from "./useStores.js"; import { useConfigContext as p } from "../core/ConfigContext/preact/context.js"; import { EMPTY_OBJECT as u } from "../utils/value/constants.js"; const C = (r, e) => { const { payByLinkFilters: t } = p().endpoints, { data: s, isFetching: o, error: i } = m( F( () => ({ fetchOptions: { enabled: !!t && (e ?? !0), keepPrevData: !0 }, queryFn: async () => t?.(u) }), [t, e] ) ), { filteredStores: n, allStores: c, isFetching: a, error: l } = f(r); return { filters: s, stores: n, isFetching: a || o, allStores: c, filterError: i, storeError: l }; }; export { C as default };