Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(headless): add listen to notification_received in headless service #3834

Merged
merged 2 commits into from
Jul 21, 2023

Conversation

iv-stpn
Copy link
Contributor

@iv-stpn iv-stpn commented Jul 21, 2023

What change does this PR introduce?

When the headless package was introduced, the notification_received event did not yet exist (it was added two weeks later), a corresponding method to listen to that event hasn't been added to headlessService yet.

This PR introduces the method listenNotificationReceive (following the same naming scheme as listenUnseenCountChange for the event unseen_count_changed) with corresponding doc updates.

Why was this change needed?

Use cases that may require this method include :

  • Updating the UI in real-time when a new notification is received (e.g. having multiple unread counts updated manually)
  • Displaying a toast with details about the notification when the notification is received

Other information (Screenshots)

image
image

Jest test is successful

@github-actions github-actions bot added documentation Improvements or additions to documentation community labels Jul 21, 2023
Copy link
Member

@BiswaViraj BiswaViraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🌟

@BiswaViraj BiswaViraj added this pull request to the merge queue Jul 21, 2023
Merged via the queue into novuhq:next with commit 6091f76 Jul 21, 2023
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants