Skip to content

Commit

Permalink
Add core/data temp placeholder types
Browse files Browse the repository at this point in the history
  • Loading branch information
tyxla committed Feb 13, 2023
1 parent f2cb26e commit e0f34a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ const circle = (
</SVG>
);

type CoreDataPlaceholder = {
hasFinishedResolution: ( ...args: unknown[] ) => boolean;
};

export const HelpCenterMoreResources = () => {
const { __ } = useI18n();
const sectionName = useSelector( getSectionName );
Expand All @@ -42,7 +46,7 @@ export const HelpCenterMoreResources = () => {
hasSeenWhatsNewModal: (
select( HELP_CENTER_STORE ) as HelpCenterSelect
).getHasSeenWhatsNewModal(),
doneLoading: select( 'core/data' ).hasFinishedResolution(
doneLoading: ( select( 'core/data' ) as CoreDataPlaceholder ).hasFinishedResolution(
HELP_CENTER_STORE,
'getHasSeenWhatsNewModal',
[]
Expand Down
6 changes: 5 additions & 1 deletion packages/help-center/src/components/help-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ import { forwardRef } from 'react';
import { HELP_CENTER_STORE } from '../stores';
import type { HelpCenterSelect } from '@automattic/data-stores';

type CoreDataPlaceholder = {
hasFinishedResolution: ( ...args: unknown[] ) => boolean;
};

const HelpIcon = forwardRef< SVGSVGElement >( ( _, ref ) => {
const { unreadCount, doneLoading, hasSeenWhatsNewModal } = useSelect(
( select ) => ( {
unreadCount: ( select( HELP_CENTER_STORE ) as HelpCenterSelect ).getUnreadCount(),
doneLoading: select( 'core/data' ).hasFinishedResolution(
doneLoading: ( select( 'core/data' ) as CoreDataPlaceholder ).hasFinishedResolution(
HELP_CENTER_STORE,
'getHasSeenWhatsNewModal',
[]
Expand Down

0 comments on commit e0f34a5

Please sign in to comment.