Last active
June 20, 2024 17:14
-
-
Save elijahbenizzy/238196b05d123353999b9263c3c1a76f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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