Robot exports a variety of functions that compose to build state machines. Many of the functions, such as state and transition are variadic, meaning they can take any number of arguments and the order doesn't matter (much). This is a common pattern you'll notice in usage; the result is easier composition.
# Main exports
Table of Contents
Robot does not verify the correctness of the state machines you create by default. This is for bundle size purposes; in production you wouldn't want your machines to throw, and this code takes up valuable space.
Instead debugging messages are provided by the debug module,
robot3/debug. Simply import the module anywhere before you call
A common pattern is to have a
dev.js that imports the debug module and your main. This way the
dev.js is not included in your production build.
Or if you're using web modules then include a script tag before your main:
<script type="module" src="https://unpkg.com/robot3/debug"></script>
<script type="module" src="./main.js"></script>