Hi, I have a plugin which based on user actions stores some local data. For now, I figured it would make the most sense to just keep this data in a local variable in my plugin's init method, though I'm open to other ideas. For example,
The question I have is, how can I retrieve this data afterwards from my application code? My first thought was to define a custom command for this, but then I saw that execCommand only returns true or false. What I really would like to do (I think) is define a custom method or even field on the editor for holding or retrieving this data. Is there a recommended way of doing this? Or am I headed down the wrong path, and should the plugin not attempt to store this data on its own at all but instead pass it off somewhere else?
var localData = {}; editor.on('whatever', function() { // possibly put stuff in localData });
The question I have is, how can I retrieve this data afterwards from my application code? My first thought was to define a custom command for this, but then I saw that execCommand only returns true or false. What I really would like to do (I think) is define a custom method or even field on the editor for holding or retrieving this data. Is there a recommended way of doing this? Or am I headed down the wrong path, and should the plugin not attempt to store this data on its own at all but instead pass it off somewhere else?