mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
chore: clean up hook
This commit is contained in:
parent
9d2cde849f
commit
cde4aa8b48
@ -1,8 +1,8 @@
|
|||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { formatApiPath } from 'utils/formatPath';
|
import { formatApiPath } from 'utils/formatPath';
|
||||||
import { useConditionalSWR } from 'hooks/api/getters/useConditionalSWR/useConditionalSWR.js';
|
|
||||||
import handleErrorResponses from 'hooks/api/getters/httpErrorResponseHandler';
|
import handleErrorResponses from 'hooks/api/getters/httpErrorResponseHandler';
|
||||||
import type { SWRConfiguration } from 'swr';
|
import type { SWRConfiguration } from 'swr';
|
||||||
|
import useSWR from 'swr';
|
||||||
|
|
||||||
type UnknownFlagEnvReport = {
|
type UnknownFlagEnvReport = {
|
||||||
environment: string;
|
environment: string;
|
||||||
@ -31,9 +31,7 @@ const DEFAULT_DATA: UnknownFlagsResponse = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const useUnknownFlags = (options?: SWRConfiguration) => {
|
export const useUnknownFlags = (options?: SWRConfiguration) => {
|
||||||
const { data, error, mutate } = useConditionalSWR<UnknownFlagsResponse>(
|
const { data, error, mutate } = useSWR<UnknownFlagsResponse>(
|
||||||
true,
|
|
||||||
DEFAULT_DATA,
|
|
||||||
formatApiPath(ENDPOINT),
|
formatApiPath(ENDPOINT),
|
||||||
fetcher,
|
fetcher,
|
||||||
options,
|
options,
|
||||||
|
Loading…
Reference in New Issue
Block a user