I am creating a simple addon for Blender that handles easy animation changes between different actions. Everything works, but I am unable to find out properly how to catch if the user changes Start, Current, and End frame on Timeline, the same applies if the user changes Action in Action Editor (Dope Sheet).
I succeeded temporarily by using the poll function, but that is not an elegant solution at all. Moreover, it turned out that I cannot change some global vars I have added.
My second try was to add modal operator and catch all mouse clicks to refresh some data and that works to some degree, but I am still not satisfied with it.
Currently, I handle list view changes, so when it user clicks on other entry, say on Idle from Spawn I save states to Spawn (frame start, frame end, and current Action), then switch to Idle, check if the animation has Action assigned, and if not I create one then assign it (or saved one). So I have all states saved up to the current selection. If the user changes current_frame I can handle it with bpy.app.handlers.frame_change_post as @Gorgious stated, but I can't update frame_start, frame_end & dope sheet Action until the user clicks again on some other element.
I'm using Blender 2.79.
What are my options here?

frame_change_postandframe_change_prehandler can be used to execute a method when the frame changes. See : https://docs.blender.org/api/current/bpy.app.handlers.html For the Actions I don't think that you can unless you link a method to thedepsgraph_update_postordepsgraph_update_preand loop over all actions to see which one is selected. (Not really optimized though) – Gorgious Oct 23 '20 at 06:27bpy.app.handlers.scene_update_pre(and post) are the pre 2.8 versions of handlers that get run a squizzilion times to catch events in. – batFINGER Oct 27 '20 at 12:08