Skip to content

Commit

Permalink
Remove notification$
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljscript committed Oct 10, 2024
1 parent 3ef4ef0 commit c57b199
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
8 changes: 2 additions & 6 deletions packages/notifications/src/notification-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const notificationManagerMaker = ({
}

const config = configManagerMaker({storage: configStorage})
const {events, unreadCounterByGroup$, notification$} = eventsManagerMaker({
const {events, unreadCounterByGroup$} = eventsManagerMaker({
storage: eventsStorage,
config,
display,
Expand All @@ -51,7 +51,6 @@ export const notificationManagerMaker = ({
events,
config,
unreadCounterByGroup$,
notification$,
}
}

Expand Down Expand Up @@ -83,12 +82,10 @@ const eventsManagerMaker = ({
unreadCounterByGroup$: BehaviorSubject<
Readonly<Map<Notifications.Group, number>>
>
notification$: Subject<Notifications.Event>
} => {
const unreadCounterByGroup$ = new BehaviorSubject<
Map<Notifications.Group, number>
>(buildUnreadCounterDefaultValue())
const notification$ = new Subject<Notifications.Event>()

const updateUnreadCounter = async () => {
const allEvents = await events.read()
Expand Down Expand Up @@ -131,7 +128,6 @@ const eventsManagerMaker = ({
await storage.setItem('events', [...allEvents, event])
if (!event.isRead) {
await updateUnreadCounter()
notification$.next(event)
display(event)
}
},
Expand All @@ -140,7 +136,7 @@ const eventsManagerMaker = ({
unreadCounterByGroup$.next(buildUnreadCounterDefaultValue())
},
}
return {events, unreadCounterByGroup$, notification$}
return {events, unreadCounterByGroup$}
}

const configManagerMaker = ({
Expand Down
1 change: 0 additions & 1 deletion packages/types/src/notifications/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ export type NotificationManager = {
unreadCounterByGroup$: BehaviorSubject<
Readonly<Map<NotificationGroup, number>>
>
notification$: Subject<NotificationEvent>

// Events represent a notification event that was trigger by a config rule
events: {
Expand Down

0 comments on commit c57b199

Please sign in to comment.