Ash.Notifier
Is there a way to have a parametrized notifier, just like with validators/preparation/changes
6 Replies
Nope
Unfortunately
But you can read from the changeset context and set a piece of context in all actions for a resource
this is for the ash authentication thing, ideally we would prefer that the user just provides a template to the notifier [if he changed how the livesocket id], should we just make the notifier live inside accounts/notifiers and document that if the user change the way the livesocket id is set, he should update the notifier?
You'd do that in a DSL
We can add notifiers programatically
in the extension
the issue is that if we make them define a function as a template in the DSL why wouldn't we use it in the set_live_socket_id and make their lives easier
I don't think I understand
You may need to show me examples of what you're getting at or what it might look like
Parameterizing a notifier and adding config to a resource would contain the same amount of information
I think we'll maybe have to rethink how we can implement that, the issue is that the livesocket id should be a function that takes the token record,, and using set_context won't resolve that, + there are cases like the expunge_expired where we don't have the token data inside the changeset
tomorrow I will open a thread and tag you and james