Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,17 @@ The list below captures what may need to add depending on your usage:
Life cycle events are directly managed on the application controller
and are prefixed with `on_*`.

* **on_server_start** : Executed at server.start() call while passing the server as argument.
* **on_server_bind** : WSLinkServer is getting bound to trame so you can attach your own routes. Its instance will be passed as argument to callback.
* **on_server_ready** : All protocols initialized and available for client to connect
* **on_client_connected** : Connection established to server
* **on_client_exited** : Linked to browser "beforeunload" event
* **on_server_exited** : Trame is exiting its event loop

* **on_server_reload** : If callback registered it is used for reloading server side modules
* **on_error** : JS error forwarded (msg:str) on the python
* **on_exception** : Server exception occurred when interacting with the UI. The exception instance is provided as arg.

* **on_server_reload** : If callback registered it is used for reloading server side modules

## Reserved state entries

Expand Down
4 changes: 3 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,16 @@ Life cycle callbacks
Life cycle events are directly managed on the application controller
and are prefixed with `on_*`.

* **on_server_start** : Executed at server.start() call while passing the server as argument.
* **on_server_bind** : WSLinkServer is getting bound to trame so you can attach your own routes. Its instance will be passed as argument to callback.
* **on_server_ready** : All protocols initialized and available for client to connect
* **on_client_connected** : Connection established to server
* **on_client_exited** : Linked to browser "beforeunload" event
* **on_server_start** : Trame is starting its event loop
* **on_server_exited** : Trame is exiting its event loop
* **on_server_reload** : If callback registered it is used for reloading server side modules
* **on_error** : A JavaScript error has occurred in the client, can be used to do something on the server when this occurs

* **on_exception** : Server exception occurred when interacting with the UI. The exception instance is provided as arg.

Reserved state entries
--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion examples/validation/decorators/default_class_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def on_ready(self, *args, **kwargs):

@life_cycle.on_error
def on_error(self, message):
print(f"A JS error occured: {message}")
print(f"A JS error occurred: {message}")

def ui(self):
with SinglePageLayout(self.server) as layout:
Expand Down