/** @license MIT | @cube-dev/ui-kit v0.0.0-canary-f1f3d22 | Cube Dev Team */
import { useEvent } from "../../../../_internal/hooks/use-event.js";
import { NotificationsContext } from "../NotificationsContext/NotificationsContext.js";
import { useContext, useEffect } from "react";

//#region src/components/overlays/NewNotifications/hooks/use-notifications-observer.ts
function useNotificationsObserver(callback) {
	const { addOnDismissListener } = useContext(NotificationsContext) ?? {};
	const callbackEvent = useEvent(callback);
	useEffect(() => addOnDismissListener?.(callbackEvent), [addOnDismissListener]);
}

//#endregion
export { useNotificationsObserver };
//# sourceMappingURL=use-notifications-observer.js.map