MCPcopy Index your code
hub / github.com/pyscript/pyscript / trigger

Method trigger

core/src/stdlib/pyscript/events.py:50–58  ·  view source on GitHub ↗

Trigger the event and notify all listeners with the given `result`.

(self, result)

Source from the content-addressed store, hash-verified

48 self._listeners = []
49
50 def trigger(self, result):
51 """
52 Trigger the event and notify all listeners with the given `result`.
53 """
54 for listener in self._listeners:
55 if is_awaitable(listener):
56 asyncio.create_task(listener(result))
57 else:
58 listener(result)
59
60 def add_listener(self, listener):
61 """

Calls 2

is_awaitableFunction · 0.90
listenerFunction · 0.50