Skip to content

Commit

Permalink
Merge pull request #308 from 10up/upkeep/hook-use-is-supported-taxonomy
Browse files Browse the repository at this point in the history
upkeep: add TS support for `useIsSupportedTaxonomy` hook
  • Loading branch information
fabiankaegy authored Apr 16, 2024
2 parents a7df65a + e09222f commit 778f417
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';

export const useIsSupportedTaxonomy = (postType, taxonomyName) => {
export const useIsSupportedTaxonomy = (postType: string, taxonomyName: string) => {
return useSelect(
(select) => {
const postTypeObject = select(coreStore).getPostType(postType);
Expand All @@ -16,5 +16,5 @@ export const useIsSupportedTaxonomy = (postType, taxonomyName) => {
return [!!isSupportedTaxonomy, hasResolvedPostType];
},
[postType, taxonomyName],
);
) as [isSupportedTaxonomy: boolean, hasResolvedPostType: boolean];
};

0 comments on commit 778f417

Please sign in to comment.