-
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.
refactor: rtk query campagin (#2260)
- Loading branch information
1 parent
985cfa2
commit 10c0d27
Showing
19 changed files
with
614 additions
and
771 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
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 limitOrderApi from 'services/limitOrder' | ||
|
||
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 useInvalidateTagKyberAi = () => { | ||
return useInvalidateTags(kyberAIApi) | ||
} | ||
|
||
export const useInvalidateTagLimitOrder = () => { | ||
return useInvalidateTags(limitOrderApi) | ||
} |
Oops, something went wrong.