How to trigger some JS code if the signup form is opened or closed?

Is it possible to monitor this event (open and closing of the signup modal) via the plugin API and fire some other JS code?

Is there a boilerplate code to monitor all events fired by the plugin API and log via the console?