Dispacher
Source code in zenaura/client/dispatcher.py
bind(id, event, maybe_awaitable)
Subscribe an event to an element, window, or document and dispatch a sync or async callback. Ensures the provided function has the correct signature.
:param id: ID attached to the component, or 'window'/'document' for global bindings. :param event: Event name (e.g., "click", "resize", "keydown"). :param coroutine: Callback coroutine function. :return: None if binding succeeds; raises an exception otherwise.
Source code in zenaura/client/dispatcher.py
dispatch(coro_func, *args, **kwargs)
Wrap asyncio.run to schedule and run the given coroutine.
:param coro_func: The coroutine function to execute. :param args: Positional arguments for the coroutine. :param kwargs: Keyword arguments for the coroutine.