UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

1 lines 977 B
{"version":3,"file":"useRegisterNotification.cjs","sources":["../../../../src/lib/Notification/useRegisterNotification.ts"],"sourcesContent":["import {useCallback} from 'react';\n\nimport {useNotificationContext} from './NotificationContext.ts';\nimport {Actions} from './NotificationReducer.ts';\nimport type {NotificationProps, Id} from './NotificationReducer.ts';\n\nexport const useRegisterNotification = () => {\n const {dispatch} = useNotificationContext();\n return useCallback(\n (id: Id, props: NotificationProps) => {\n dispatch({id, props, type: Actions.NOTIFICATION_REGISTER});\n },\n [dispatch]\n );\n};\n"],"names":["useRegisterNotification","dispatch","useNotificationContext","useCallback","id","props","Actions"],"mappings":"oMAMaA,EAA0B,IAAM,CACnC,KAAA,CAAC,SAAAC,CAAQ,EAAIC,yBAAuB,EACnC,OAAAC,EAAA,YACH,CAACC,EAAQC,IAA6B,CAClCJ,EAAS,CAAC,GAAAG,EAAI,MAAAC,EAAO,KAAMC,EAAAA,QAAQ,sBAAsB,CAC7D,EACA,CAACL,CAAQ,CACb,CACJ"}