I'm trying to implement an app and a crucial part of it composed of something like below,
get_state, set_state = mo.state(False)
def wait_for_switch() -> bool:
while True:
if get_state():
return True
switch = mo.ui.switch(on_change=set_state)
then calling
But when switching, the loop continues
Is there a way to terminate this while loop with switch?