Tab event execution time

There are several events to be triggered for “Tab”. The execution time taken is so weird. For instance, the execution sequence for “Tab” events are tabInit(next Tab), tabMounted(next Tab) and at last tabBeforeRemove(prior Tab). How to handle on following case.

Prior TabInit: app.on(‘resize’, functionA);
Prior TabBeforeRemove:‘resize’);
Next TabInit: app.on(‘resize’, functionB);
Next TabBeforeRemove:‘resize’);

The above sequence will become next TabInit could not run functionB because such event are removed by Prior TabBeforeRemove'resize;). How can I overcome it?

When you do .off you need to pass the function, otherwise you remove all resize event listeners:

app.on(‘resize’, functionA);‘resize’, functionA);