Skip to content

Commit 6751f47

Browse files
committed
add index section for responding to events
1 parent cbcecff commit 6751f47

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

docs/source/adding-interactivity/index.rst

+10-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Adding Interactivity
2222
:link: responding-to-events
2323
:link-type: doc
2424

25-
...
25+
Define event handlers and learn about the available event types they can be
26+
bound to.
2627

2728
.. grid-item-card:: :octicon:`package-dependencies` Components With State
2829
:link: components-with-state
@@ -54,7 +55,12 @@ Adding Interactivity
5455
Section 1: Responding to Events
5556
-------------------------------
5657

57-
...
58+
IDOM lets you add event handlers to your parts of the interface. This means that you can
59+
define synchronous or asynchronous functions that are triggered when a particular user
60+
interaction occurs like clicking, hovering, of focusing on form inputs, and more.
61+
62+
.. example:: adding_interactivity.button_prints_message
63+
:activate-result:
5864

5965
.. card::
6066
:link: responding-to-events
@@ -63,7 +69,8 @@ Section 1: Responding to Events
6369
:octicon:`book` Read More
6470
^^^^^^^^^^^^^^^^^^^^^^^^^
6571

66-
...
72+
Define event handlers and learn about the available event types they can be bound
73+
to.
6774

6875

6976
Section 2: Components with State

src/idom/core/dispatcher.py

+2
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,8 @@ async def _single_incoming_loop(
220220
layout: LayoutType[LayoutUpdate, LayoutEvent], recv: RecvCoroutine
221221
) -> None:
222222
while True:
223+
# We need to fire and forget here so that we avoid waiting on the completion
224+
# of this event handler before receiving and running the next one.
223225
ensure_future(layout.deliver(await recv()))
224226

225227

0 commit comments

Comments
 (0)