diff --git a/shiny/api-examples/Calc/app.py b/shiny/api-examples/Calc/app.py deleted file mode 100644 index 603313593..000000000 --- a/shiny/api-examples/Calc/app.py +++ /dev/null @@ -1,36 +0,0 @@ -import random -import time - -from shiny import App, Inputs, Outputs, Session, reactive, render, ui - -app_ui = ui.page_fluid( - ui.input_action_button("first", "Invalidate first (slow) computation"), - " ", - ui.input_action_button("second", "Invalidate second (fast) computation"), - ui.br(), - ui.output_ui("result"), -) - - -def server(input: Inputs, output: Outputs, session: Session): - @reactive.Calc - def first(): - input.first() - p = ui.Progress() - for i in range(30): - p.set(i / 30, message="Computing, please wait...") - time.sleep(0.1) - p.close() - return random.randint(1, 1000) - - @reactive.Calc - def second(): - input.second() - return random.randint(1, 1000) - - @render.ui - def result(): - return first() + second() - - -app = App(app_ui, server) diff --git a/shiny/api-examples/Effect/app.py b/shiny/api-examples/Effect/app.py deleted file mode 100644 index 8b9c2c599..000000000 --- a/shiny/api-examples/Effect/app.py +++ /dev/null @@ -1,17 +0,0 @@ -from shiny import App, Inputs, Outputs, Session, reactive, ui - -app_ui = ui.page_fluid(ui.input_action_button("btn", "Press me!")) - - -def server(input: Inputs, output: Outputs, session: Session): - @reactive.Effect - @reactive.event(input.btn) - def _(): - ui.insert_ui( - ui.p("Number of clicks: ", input.btn()), - selector="#btn", - where="afterEnd", - ) - - -app = App(app_ui, server)