From b13adcfb627531d99cb55b94a55ababddb693a68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Ritzl?= Date: Wed, 20 Jun 2018 07:36:16 +0200 Subject: [PATCH] Added listener documentation --- README.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/README.md b/README.md index a2f2a71..f6daaa1 100644 --- a/README.md +++ b/README.md @@ -334,5 +334,35 @@ Check if Monarch is busy showing and/or hiding a screen. * ```busy``` (boolean) - True if busy hiding and/or showing a screen. +### monarch.add_listener([url]) +Add a URL that will be notified of navigation events. + +**PARAMETERS** +* ```url``` (url) - URL to send navigation events to. Will use current URL if omitted. + + +### monarch.remove_listener([url]) +Remove a previously added listener. + +**PARAMETERS** +* ```url``` (url) - URL to remove. Will use current URL if omitted. + + ### monarch.debug() Enable verbose logging of the internals of Monarch. + + +### monarch.SCREEN_VISIBLE +Message sent to listeners when a screen becomes visible. + +**PARAMETERS** +* ```screen``` (hash) - Id of the screen +* ```previous_screen``` (hash) - Id of theprevious screen (if any) + + +### monarch.SCREEN_HIDDEN +Message sent to listeners when a screen is hidden. + +**PARAMETERS** +* ```screen``` (hash) - Id of the screen +* ```next_screen``` (hash) - Id of the next screen (if any)