-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cc5c7e
commit 78b1b1d
Showing
8 changed files
with
46 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { useCallback } from 'react' | ||
import announcementApi from 'services/announcement' | ||
import campaignApi from 'services/campaign' | ||
|
||
import kyberAIApi from 'pages/TrueSightV2/hooks/useKyberAIData' | ||
import { useAppDispatch } from 'state/hooks' | ||
|
||
const useInvalidateTags = (api: any) => { | ||
const dispatch = useAppDispatch() | ||
return useCallback( | ||
(tag: string | string[]) => { | ||
dispatch(api.util.invalidateTags(Array.isArray(tag) ? tag : [tag])) | ||
}, | ||
[dispatch, api], | ||
) | ||
} | ||
|
||
export const useInvalidateTagAnnouncement = () => { | ||
return useInvalidateTags(announcementApi) | ||
} | ||
|
||
export const useInvalidateTagCampaign = () => { | ||
return useInvalidateTags(campaignApi) | ||
} | ||
|
||
export const useInvalidateTagKyberAi = () => { | ||
return useInvalidateTags(kyberAIApi) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters