allow_self_loops=True
in the mo.state
constructor.import marimo __generated_with = "0.7.0" app = marimo.App(width="medium") @app.cell def __(): import marimo as mo return mo, @app.cell def __(mo): get_state, set_state = mo.state(0, allow_self_loops=True) return get_state, set_state @app.cell def __(get_state, set_state): if (i := get_state()) < 10: print(i) set_state(lambda v: v + 1) return i, if __name__ == "__main__": app.run()