-
Notifications
You must be signed in to change notification settings - Fork 91
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
Feature: add site-wide handle_info callbacks #578
Feature: add site-wide handle_info callbacks #578
Conversation
70d9489
to
ff037d9
Compare
ff037d9
to
92a4a38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ddink great work! Sorry for the delay, things piled up with ElixirConf. In overall it's looking good, just left a few comments that we need to address before merging it. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ddink one last small change and then we're done with this PR. I'm gonna check the live_admin PR now. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ddink that looks good, great contribution! I'll merge into main and release right after v0.1 since that version is frozen for new features, but that should happen soon. Thanks!
Thanks @ddink ! |
What will it allow you to do that you can't do today?
These changes will make it possible to add site-wide
handle_info
callbacks that will be applied to each Beacon page. There is also a complementary pull-request to beacon_live_admin that adds support for administering the CRUD of these site-wide callbacks.Why do you need this feature and how will it benefit other users?
This feature will give users the ability to handle messages sent by
Kernel.send/2
. Commonly, this can be used to do things like put flash messages, navigate to another LiveView, work with streams, etc. in response to messages sent by the application.Are there any drawbacks to this feature?
This feature is not designed to create page-specifichandle_info
callbacks—just site-wide callbacks that are useable on all of a site’s pages. I’m happy to add a page-specifichandle_info
callbacks feature at a later point, though.Changes tohandle_info
callbacks through the admin require a recompile before they are useable. They are not immediately useable upon a refresh of a Beacon page the way that an update to a Beacon page is immediately viewable.