Skip to content

Instantly share code, notes, and snippets.

@elijahbenizzy
Last active June 20, 2024 17:14
Show Gist options
  • Save elijahbenizzy/238196b05d123353999b9263c3c1a76f to your computer and use it in GitHub Desktop.
Save elijahbenizzy/238196b05d123353999b9263c3c1a76f to your computer and use it in GitHub Desktop.
from burr.core import ApplicationBuilder, default, expr
app = (
ApplicationBuilder()
.with_actions(
count=count,
done=done # implementation left out above
).with_transitions(
("counter", "counter", expr("count < 10")), # Keep counting if the counter is < 10
("counter", "done", default) # Otherwise, we're done
).with_state(count=0)
.with_entrypoint("counter") # we have to start somewhere
.build()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment