useNotificationCenter
@spartanfx/react / useNotificationCenter
Function: useNotificationCenter()
useNotificationCenter(
options?):INotificationCenterHook
Hook for managing notifications with web storage backing
Can be used in two ways:
- With config: Creates a new web storage instance
- Without config: Accesses the notification center from context
Parameters
options?
Returns
Example
// Create instance (at app root)
const config = useNotificationCenter({ storage: 'local', storageKey: 'my-app' });
<NotificationCenterProvider config={config}>...</NotificationCenterProvider>
// Access from context (in child components)
const { addNotification, items } = useNotificationCenter();