diff --git a/src/pydase/utils/serializer.py b/src/pydase/utils/serializer.py index 5285863..f4bfa7f 100644 --- a/src/pydase/utils/serializer.py +++ b/src/pydase/utils/serializer.py @@ -56,7 +56,12 @@ def frontend(func: Callable[..., Any]) -> Callable[..., Any]: def render_in_frontend(func: Callable[..., Any]) -> bool: - """Determines if the method is decorated with the `@frontend` decorator.""" + """Determines if the method should be rendered in the frontend. + + It checks if the "@frontend" decorator was used or the method is a coroutine.""" + + if inspect.iscoroutine(func): + return True try: return func._display_in_frontend # type: ignore