[SOLVED] UseMoralisSuscription not responding

Hey, I’m trying to use useMoralisSubscription to get when an event is created in my frontend. So that based on the content of that event I can do different things e.g dispatch notification. For now, i’m trying to access the raw data by console logging. The subscription doesnt seem to be firing. Any help?

useMoralisSubscription("PlayedEvent", (q) => q, [], {
    onUpdate: (data) => console.log(data),
  });

Did you try updating the database?
Also make sure the hook is in the rendered component

Yes. I actually have a function in my contract that emits that event whenever its called. Its on my frontend using web3ExecuteFunction but it doesnt seem to catch the event fired live and its getting updated in my database.

Is the hook in the rendered component to update or in the root component?

It’s in the rendered component.

Try adding enabled: true

useMoralisSubscription("PlayedEvent", (q) => q, [], {
    onUpdate: (data) => console.log(data),
    enabled: true,
  });

I just tried this. It still doesn’t work. Still debugging though.

Face Palm!

I’ve resolved it. It was a typo. Thanks @qudusayo