I am trying to use useMoralisSubscription()
hook in react-moralis
to get live updates when a new row is created in my table. If I manually create a new row from the Moralis web interface the onCreate
handler triggers properly. It does not seem to trigger when Moralis is watching contract events and putting new rows successfully in that same table. Any help would be appreciated!
my component snippet:
const Custodians = () => {
useMoralisSubscription("MultiSigAlertNewApprovalX", q => q, [], {
onCreate: data => console.log(data),
onDelete: data => console.log(data),
});
...