@@ -51,17 +51,14 @@ def display_content(_):
51
51
app .total_calls = Value ("i" , 0 )
52
52
53
53
@app .callback (
54
- [Output ("list-container" , "children" ), Output ("new-item" , "value" )],
55
- [
56
- Input ("add" , "n_clicks" ),
57
- Input ("new-item" , "n_submit" ),
58
- Input ("clear-done" , "n_clicks" ),
59
- ],
60
- [
61
- State ("new-item" , "value" ),
62
- State ({"item" : ALL }, "children" ),
63
- State ({"item" : ALL , "action" : "done" }, "value" ),
64
- ],
54
+ Output ("list-container" , "children" ),
55
+ Output ("new-item" , "value" ),
56
+ Input ("add" , "n_clicks" ),
57
+ Input ("new-item" , "n_submit" ),
58
+ Input ("clear-done" , "n_clicks" ),
59
+ State ("new-item" , "value" ),
60
+ State ({"item" : ALL }, "children" ),
61
+ State ({"item" : ALL , "action" : "done" }, "value" ),
65
62
)
66
63
def edit_list (add , add2 , clear , new_item , items , items_done ):
67
64
app .list_calls .value += 1
@@ -99,18 +96,16 @@ def edit_list(add, add2, clear, new_item, items, items_done):
99
96
100
97
@app .callback (
101
98
Output ({"item" : MATCH }, "style" ),
102
- [ Input ({"item" : MATCH , "action" : "done" }, "value" )] ,
99
+ Input ({"item" : MATCH , "action" : "done" }, "value" ),
103
100
)
104
101
def mark_done (done ):
105
102
app .style_calls .value += 1
106
103
return style_done if done else style_todo
107
104
108
105
@app .callback (
109
106
Output ({"item" : MATCH , "preceding" : True }, "children" ),
110
- [
111
- Input ({"item" : ALLSMALLER , "action" : "done" }, "value" ),
112
- Input ({"item" : MATCH , "action" : "done" }, "value" ),
113
- ],
107
+ Input ({"item" : ALLSMALLER , "action" : "done" }, "value" ),
108
+ Input ({"item" : MATCH , "action" : "done" }, "value" ),
114
109
)
115
110
def show_preceding (done_before , this_done ):
116
111
app .preceding_calls .value += 1
@@ -124,7 +119,7 @@ def show_preceding(done_before, this_done):
124
119
return out
125
120
126
121
@app .callback (
127
- Output ("totals" , "children" ), [ Input ({"item" : ALL , "action" : "done" }, "value" )]
122
+ Output ("totals" , "children" ), Input ({"item" : ALL , "action" : "done" }, "value" )
128
123
)
129
124
def show_totals (done ):
130
125
app .total_calls .value += 1
@@ -253,7 +248,7 @@ def fibonacci_app(clientside):
253
248
]
254
249
)
255
250
256
- @app .callback (Output ("series" , "children" ), [ Input ("n" , "value" )] )
251
+ @app .callback (Output ("series" , "children" ), Input ("n" , "value" ))
257
252
def items (n ):
258
253
return [html .Div (id = {"i" : i }) for i in range (n )]
259
254
@@ -266,7 +261,7 @@ def items(n):
266
261
}
267
262
""" ,
268
263
Output ({"i" : MATCH }, "children" ),
269
- [ Input ({"i" : ALLSMALLER }, "children" )] ,
264
+ Input ({"i" : ALLSMALLER }, "children" ),
270
265
)
271
266
272
267
app .clientside_callback (
@@ -277,13 +272,13 @@ def items(n):
277
272
}
278
273
""" ,
279
274
Output ("sum" , "children" ),
280
- [ Input ({"i" : ALL }, "children" )] ,
275
+ Input ({"i" : ALL }, "children" ),
281
276
)
282
277
283
278
else :
284
279
285
280
@app .callback (
286
- Output ({"i" : MATCH }, "children" ), [ Input ({"i" : ALLSMALLER }, "children" )]
281
+ Output ({"i" : MATCH }, "children" ), Input ({"i" : ALLSMALLER }, "children" )
287
282
)
288
283
def sequence (prev ):
289
284
global fibonacci_count
@@ -294,7 +289,7 @@ def sequence(prev):
294
289
return len (prev )
295
290
return int (prev [- 1 ] or 0 ) + int (prev [- 2 ] or 0 )
296
291
297
- @app .callback (Output ("sum" , "children" ), [ Input ({"i" : ALL }, "children" )] )
292
+ @app .callback (Output ("sum" , "children" ), Input ({"i" : ALL }, "children" ))
298
293
def show_sum (seq ):
299
294
global fibonacci_sum_count
300
295
fibonacci_sum_count = fibonacci_sum_count + 1
0 commit comments