EmbeddedClient.on() and .off() listener

Description
I use .on(“user-updated”) method but when the listener .on(“connection-change”) with payload.state === ‘Closed’ I want to call .off(“user-updated”) but it does not perform anything.

Details on your question, workflow or the problem you’re trying to solve.

// this listener is hiring
 this.client.on('user-updated', () => {
// some code that works
    });
    
//also hiring
this.client.on('connection-change', (connection) => {
      console.log(connection);
      if (connection.state === 'Closed') {
//does not work
        this.client.off('user-updated', () => console.log('meeting stopped'));
      }
    });

Also I tried to perform off(‘user-updated’) below its on - pair - but unfortunately it does not work.

I’m working via “@zoom/meetingsdk”: “^3.1.6”,