This code is part of my talk about the use of xState to get control of a UI
yarn install;
yarn start;
In the src/machines folder is possible to see a machine representing a flow that shows and hides a loading depending on the return status of an HTTP request.
To see the machine in action install the xState Chrome extension