👋 Hey, sorry I haven't gotten a chance to check out this project until now!
This is maybe more of a discussion than an issue, but I see you have a all_events and subscribe_all functions. I did actually consider a couple of options for ecto_watch:
- Allowing people to specify
{User, [:inserted, :updated, :deleted]} as watchers and EctoWatch.subscribe({User, [:inserted, :updated, :deleted]}) for subscribing
- Allowing people to specify
{User, :all} as watchers and EctoWatch.subscribe({User, :all}) for subscribing
In the end I decided (at least for the time being) that I would require that people be more explicit about what they're setting up and subscribing to. Especially for the configuration of the watchers it also felt like it was good to stick with requiring that there be one entry in the watchers list for every watcher because each one ends up creating a supervised GenServer.
But this all be a bit unnecessary. Maybe it would be good to allow either a list of events or the :all atom. Either way since you're creating a wrapper around ecto_watch, it could be good to follow its conventions to be less confusing to users of your project.
I'd be happy to hear your thoughts on the above two options.
👋 Hey, sorry I haven't gotten a chance to check out this project until now!
This is maybe more of a discussion than an issue, but I see you have a
all_eventsandsubscribe_allfunctions. I did actually consider a couple of options forecto_watch:{User, [:inserted, :updated, :deleted]}as watchers andEctoWatch.subscribe({User, [:inserted, :updated, :deleted]})for subscribing{User, :all}as watchers andEctoWatch.subscribe({User, :all})for subscribingIn the end I decided (at least for the time being) that I would require that people be more explicit about what they're setting up and subscribing to. Especially for the configuration of the watchers it also felt like it was good to stick with requiring that there be one entry in the
watcherslist for every watcher because each one ends up creating a supervised GenServer.But this all be a bit unnecessary. Maybe it would be good to allow either a list of events or the
:allatom. Either way since you're creating a wrapper aroundecto_watch, it could be good to follow its conventions to be less confusing to users of your project.I'd be happy to hear your thoughts on the above two options.