# `MishkaCmsCore.Notify.LiveHooks`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/notify/live_hooks.ex#L5)

`on_mount` hook that makes the topbar bell live for the current user — with zero per-page wiring.

It never blocks the page: mount assigns an empty bell (`notification_count: 0`, `notification_recent:
[]`) and defers the query to a post-mount message (loaded async, off the render path). It subscribes
to the user's own `notification:<user_id>:*` PubSub topics and attaches two hooks: a `:handle_info`
hook that re-counts on any of those broadcasts, and a `:handle_event` hook so the dropdown's actions
— open a notification, mark one read, mark all read — work on every admin page.

The badge counts **unread** notifications (`read_at IS NULL`); reading (per row, all, or by opening)
decrements it live. Attached right after `MishkaCmsCore.Layouts.Nav` in
`MishkaCmsCore.ExtensionLiveView`, so it overrides Nav's placeholder count. Subscribes on
`MishkaCmsCore.PubSub`, matching the resource's `Ash.Notifier.PubSub` topics.

# `on_mount`

# `recent`

The current user's notifications for the bell dropdown (empty when signed out). Unread rows take
priority — the newest unread first, then recent already-read rows only fill the remaining slots.

# `unread_count`

The current user's unread-notification count (0 when signed out).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
