.on() method is not working on yjs webRTC provider

I am using y-webrtc latest version. I created provider with y-webrtc and tries to use few event handlers on the provider using .on() method. But looks like its not working. Can some one please help me on this ?

I needed to use .on() method as want to know when the connection has happend and also for handling ICE failure error.

provider = new WebrtcProvider(roomId, ydoc, {
        signaling: ["wss://signaling.yjs.dev"]})

const handleICEStatus = (event) => {
      if (event.error) {
        console.error("ICE Connection failed .......", event.error);

const handleConnect = () => {
      console.log("WebRTC connectoin established.....");

yprovider.current.on("status", handleStatus);
yprovider.current.on("iceCandidate", handleICEStatus);
yprovider.current.on("connect", handleConnect);