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

First pass at an atom.signal API (inter-window communcation) #826

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

savetheclocktower
Copy link
Contributor

Fixes #822.

Description of the Change

Implements a simplified API for one window to send a signal to all windows, optionally including itself. (#822 explores scenarios where this could be needed.) We use the main process to act as a broker.

Alternate Designs

I started out envisioning that this would combine reactivity and storage, much like atom.config. But we can already use localStorage for the storage side, and I didn’t feel like reimplementing the whole thing when what’s most urgently needed is the signaling.

Possible Drawbacks

I can’t really think of any. This is a pretty thin layer over Electron’s built-in tools for communicating between the main process and the individual renderer processes.

Verification Process

None yet! This PR is in draft mode while I figure out exactly how I’m gonna test this thing.

Release Notes

  • Added atom.signal, an API for sending messages between different Pulsar windows.

@savetheclocktower savetheclocktower changed the title First pass at an atom.signal API. First pass at an atom.signal API (inter-window communcation) Dec 6, 2023
Whenever `pulsar-updater` shows a notification in any window, it will send a signal to all other windows when that notification is dismissed. The other windows can dismiss any of their `pulsar-updater` notifications.

This allows the user to dismiss _one_ notification instead of one per window.
@savetheclocktower
Copy link
Contributor Author

Updated this just now with a proof-of-concept in pulsar-updater to make sure it works.

This will stay in draft until I write some tests, but I wanted to update it while it was fresh on my mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sharing values across Pulsar windows
1 participant