punnP
Convex Community3y ago
9 replies
punn

Recommended webhook listener pattern

I have some data in a table conversations that I'm querying using an action as I'm running several queries and returning a new object type. I'm also using functions from Node runtimes, which can't be run on normal queries/mutations.

However, I want to run this action every time there's an update to conversations.

In my webapp, I'm wondering whether I should:
a) convert the action into a pure query
or
b) query conversations, include it in a useEffect dependency, and call the action within the callback

Which approach would be recommended from a best practices/efficiency standpoint?
Was this page helpful?