Using watchers in WeWeb

Hey there!

I was wondering if it was possible to use watchers in WeWeb? I know that you guys must be using it for some things in the Editor - I would love to see it added in the future.

In the meantime, would there be some kind of workaround for it?
I have read the Vue.js doc below, however I wouldn’t know where to start in WeWeb, would I have to add watchers in the custom code section?

Hi @aeynaud , adding watcher is something we have in mind, but it’s currently not available as we have to think a lot about the UX.
What is your exact usecase :)?

Hi @aurelie,

I would like to have a Trigger Workflow that triggers when my Supabase realtime table updates/receives a new row. Not sure how to proceed with that one.

I figured you guys have a “On collection fetch error” in the Trigger Workflow section and that perhaps a “On collection fetch” wouldn’t be too hard to add - but not sure if that would work with a realtime table anyway.

Many thanks in advance

The on collection fetch trigger can be added, but indeed it will probably not be helpfull as realtime is a different way to update the data.
Two ways here

  • Let plugins expose global workflows, like components can do. Then supabase will expose some workflows
  • Have the watchers added on weweb

Both solution required new features in Weweb, so i opened a ticket on our side so that product team can think about it.

I try to find a hack, but it’s working only in the editor (Vue instance is easily access inside editor, but not in the published app).

We will go back to you when product team will have analyzed this :slight_smile:

I am wondering if the best hacky approach in the meantime will be a custom plugin or component, as they have access to watch function easily

Thanks a lot @aurelie for raising the ticket!
I would love to see this come through as the realtime table trigger isn’t the only “watcher-related” event that my app would benefit from. I will have a look at custom components in the meanwhile. This will have a decent learning curve for me :slight_smile: (but that will always pay off I’m sure).

Cheers