Detecting nested form changes
What is the best way to determine whether a form has changed or not? Let's say I have a nested form for an album and nested tracks where I only modify one of them. I want to send a notification about only the track that changed using pubsub, but it appears that the pubsub event is emitted for all tracks in that album including the ones that didn't change.
3 Replies
this would be likely configured at the pubsub level, not the form level.
you can put filters on pubsub notifications https://hexdocs.pm/ash/dsl-ash-notifier-pubsub.html#pub_sub-publish-filter to write your own logic, though it would be good if we had a built-in way to do this
thank you! do you know if there is an example of this? perhaps in the Ash book?
not in the Ash book - we use pubsub in it for Album creation, so no filter required