Skip to content

Monarch 4.0.0

Choose a tag to compare

@britzl britzl released this 27 Jul 22:04
· 33 commits to master since this release

BREAKING CHANGE: Transitions are now configured through the monarch.on_transition(screen_id, fn) function. The function defines for which screen to configure transitions and sets a function to be called when a transition should be started. This function must accept (message_id, message, sender) as arguments, with message_id defining which type of transition to start:

  • transition_show_in (constant defined as monarch.TRANSITION.SHOW_IN)
  • transition_show_out (constant defined as monarch.TRANSITION.SHOW_OUT)
  • transition_back_in (constant defined as monarch.TRANSITION.BACK_IN)
  • transition_back_out (constant defined as monarch.TRANSITION.BACK_OUT)

When a transition is completed it is up to the developer to send a transition_done (constant monarch.TRANSITION.DONE) message back to the sender to indicate that the transition is completed and that Monarch can continue the navigation sequence.

BREAKING CHANGE: Focus change listeners are now configured through monarch.on_focus_changed(screen_id, fn).

NEW: Added on_post(screen_id, fn) message listener function which will be called when a screen is sent a message using monarch.post().

IMPORTANT! You must call monarch.on_message(message_id, message, sender) from the same script as the above listener setup functions are called.