Skip to content

Commit

Permalink
add machines rule
Browse files Browse the repository at this point in the history
  • Loading branch information
the-illarionov committed Aug 11, 2024
1 parent 643b934 commit 2c4d3d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/machines/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ Machines can also be spawned by other machines, but I don't have an example of t

6. Try to declare actions in `setup` in an order of their logical appearance.

7. If your actions accepts some arguments, write actions that use that arguments in that event, not in the "entry" of the state.

It will help you easily visually divide inner logic from incoming.

7. Xstate for VSCode can be buggy sometimes and break synchronization between editor and code. Don't forget about that.
You can use this code as a starter template for the machine:
Expand Down

0 comments on commit 2c4d3d0

Please sign in to comment.