I have a mime renderer that allows the user to modify the displayed data but all of the user’s changes are reverted when the user focuses on another tab and then refocuses on the data tab. I know this happens because renderModel is called whenever the tab comes into focus which re-reads the data from the file and reverts all of the changes.
I want to save the file when the user changes or closes the tab so that when they refocus the changes are persistent.
Is there an event when the user changes tabs or closes the tab that we can listen for in typescript? Or would it be better to implement saving on a timer, similar to a notebook?
Thanks in advance for your help.