/**
 * @license MIT
 * author: Cube Dev Team
 * @cube-dev/ui-kit v0.0.0-canary-c7e2378
 * Released under the MIT license.
 */

import { useContext, useEffect } from 'react';
import { useEvent } from '../../../../_internal/index.js';
import { NotificationsContext } from '../NotificationsContext/index.js';
export function useNotificationsObserver(callback) {
    const { addOnDismissListener } = useContext(NotificationsContext) ?? {};
    const callbackEvent = useEvent(callback);
    useEffect(() => addOnDismissListener?.(callbackEvent), [addOnDismissListener]);
}

        