PATH:
home
/
lab2454c
/
igpma.com
/
wp-content
/
plugins
/
woocommerce
/
packages
/
woocommerce-blocks
/
assets
/
js
/
utils
/** * External dependencies */ import { dispatch, select } from '@wordpress/data'; import type { Notice } from '@wordpress/notices'; export const hasNoticesOfType = ( context = '', type: 'default' | 'snackbar' ): boolean => { const notices: Notice[] = select( 'core/notices' ).getNotices( context ); return notices.some( ( notice: Notice ) => notice.type === type ); }; export const removeNoticesByStatus = ( status: string, context = '' ): void => { const notices = select( 'core/notices' ).getNotices(); const { removeNotice } = dispatch( 'core/notices' ); const noticesOfType = notices.filter( ( notice ) => notice.status === status ); noticesOfType.forEach( ( notice ) => removeNotice( notice.id, context ) ); };
[-] index.ts
[edit]
[-] products.js
[edit]
[+]
..
[-] attributes.js
[edit]
[-] filters.ts
[edit]
[-] attributes-query.js
[edit]
[-] shared-attributes.js
[edit]
[-] useThrottle.ts
[edit]
[-] notices.ts
[edit]
[-] global-style.js
[edit]
[+]
test