Skip to content

Commit fd8d68c

Browse files
committed
Put the docs back the way they were on main
This change is about the event proxy, not the docs. Every file under docs/ goes back to how it looks on main, so the docs can be updated separately once the move away from Sphinx is done.
1 parent d25c9cc commit fd8d68c

41 files changed

Lines changed: 114 additions & 186 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/source/guides/adding-interactivity/components-with-state/_examples/adding_state_variable/main.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def Gallery():
1313
index, set_index = hooks.use_state(0)
1414

15-
async def handle_click(event):
15+
def handle_click(event):
1616
set_index(index + 1)
1717

1818
bounded_index = index % len(sculpture_data)

‎docs/source/guides/adding-interactivity/components-with-state/_examples/isolated_state/main.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def Gallery():
1313
index, set_index = hooks.use_state(0)
1414
show_more, set_show_more = hooks.use_state(False)
1515

16-
async def handle_next_click(event):
16+
def handle_next_click(event):
1717
set_index(index + 1)
1818

19-
async def handle_more_click(event):
19+
def handle_more_click(event):
2020
set_show_more(not show_more)
2121

2222
bounded_index = index % len(sculpture_data)

‎docs/source/guides/adding-interactivity/components-with-state/_examples/multiple_state_variables/main.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ def Gallery():
1313
index, set_index = hooks.use_state(0)
1414
show_more, set_show_more = hooks.use_state(False)
1515

16-
async def handle_next_click(event):
16+
def handle_next_click(event):
1717
set_index(index + 1)
1818

19-
async def handle_more_click(event):
19+
def handle_more_click(event):
2020
set_show_more(not show_more)
2121

2222
bounded_index = index % len(sculpture_data)

‎docs/source/guides/adding-interactivity/components-with-state/_examples/when_variables_are_not_enough/main.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
def Gallery():
2020
index = 0
2121

22-
async def handle_click(event):
22+
def handle_click(event):
2323
index = index + 1
2424

2525
bounded_index = index % len(sculpture_data)

‎docs/source/guides/adding-interactivity/components-with-state/index.rst‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ Aren't Enough>`:
6666
- index = 0
6767
+ index, set_index = use_state
6868
69-
async def handle_click(event):
69+
def handle_click(event):
7070
- index = index + 1
7171
+ set_index(index + 1)
7272
@@ -78,7 +78,7 @@ After making those changes we should get:
7878
7979
index, set_index = use_state(0)
8080
81-
async def handle_click(event):
81+
def handle_click(event):
8282
set_index(index + 1)
8383
8484
We'll talk more about what this is doing :ref:`shortly <your first hook>`, but for

‎docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_remove.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ def Definitions():
77
definition_to_add, set_definition_to_add = use_state(None)
88
all_terms, set_all_terms = use_state({})
99

10-
async def handle_term_to_add_change(event):
10+
def handle_term_to_add_change(event):
1111
set_term_to_add(event["target"]["value"])
1212

13-
async def handle_definition_to_add_change(event):
13+
def handle_definition_to_add_change(event):
1414
set_definition_to_add(event["target"]["value"])
1515

16-
async def handle_add_click(event):
16+
def handle_add_click(event):
1717
if term_to_add and definition_to_add:
1818
set_all_terms({**all_terms, term_to_add: definition_to_add})
1919
set_term_to_add(None)
2020
set_definition_to_add(None)
2121

22-
async def make_delete_click_handler(term_to_delete):
23-
async def handle_click(event):
22+
def make_delete_click_handler(term_to_delete):
23+
def handle_click(event):
2424
set_all_terms({t: d for t, d in all_terms.items() if t != term_to_delete})
2525

2626
return handle_click

‎docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/dict_update.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ def Form():
1111
}
1212
)
1313

14-
async def handle_first_name_change(event):
14+
def handle_first_name_change(event):
1515
set_person({**person, "first_name": event["target"]["value"]})
1616

17-
async def handle_last_name_change(event):
17+
def handle_last_name_change(event):
1818
set_person({**person, "last_name": event["target"]["value"]})
1919

20-
async def handle_email_change(event):
20+
def handle_email_change(event):
2121
set_person({**person, "email": event["target"]["value"]})
2222

2323
return html.div(

‎docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_insert.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ def ArtistList():
66
artist_to_add, set_artist_to_add = use_state("")
77
artists, set_artists = use_state([])
88

9-
async def handle_change(event):
9+
def handle_change(event):
1010
set_artist_to_add(event["target"]["value"])
1111

12-
async def handle_click(event):
12+
def handle_click(event):
1313
if artist_to_add and artist_to_add not in artists:
1414
set_artists([*artists, artist_to_add])
1515
set_artist_to_add("")

‎docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_re_order.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ def ArtistList():
77
["Marta Colvin Andrade", "Lamidi Olonade Fakeye", "Louise Nevelson"]
88
)
99

10-
async def handle_sort_click(event):
10+
def handle_sort_click(event):
1111
set_artists(sorted(artists))
1212

13-
async def handle_reverse_click(event):
13+
def handle_reverse_click(event):
1414
set_artists(list(reversed(artists)))
1515

1616
return html.div(

‎docs/source/guides/adding-interactivity/dangers-of-mutability/_examples/list_remove.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,16 @@ def ArtistList():
88
["Marta Colvin Andrade", "Lamidi Olonade Fakeye", "Louise Nevelson"]
99
)
1010

11-
async def handle_change(event):
11+
def handle_change(event):
1212
set_artist_to_add(event["target"]["value"])
1313

14-
async def handle_add_click(event):
14+
def handle_add_click(event):
1515
if artist_to_add not in artists:
1616
set_artists([*artists, artist_to_add])
1717
set_artist_to_add("")
1818

19-
async def make_handle_delete_click(index):
20-
async def handle_click(event):
19+
def make_handle_delete_click(index):
20+
def handle_click(event):
2121
set_artists(artists[:index] + artists[index + 1 :])
2222

2323
return handle_click

0 commit comments

Comments
 (0)