Skip to content

Commit 7645d99

Browse files
authored
Update blog post to use color mode images (#228)
1 parent 427761b commit 7645d99

File tree

6 files changed

+24
-3
lines changed

6 files changed

+24
-3
lines changed

blog/2023-10-02-what-is-a-state-machine/index.mdx

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,27 @@ If you’ve worked with flowcharts or diagrammed a process on a whiteboard with
1818

1919
A state machine is a way of modeling how something works, using states and transitions to show how something changes over time in response to events.
2020

21-
![A state machine for a music player. The state machine starts in the Paused state, and on play, goes to the Playing state. On pause, it goes back to the Paused state. In any state, you can skip to the next track.](music-player-state-machine-dark.png)
21+
<ThemedImage
22+
alt="A state machine for a music player. The state machine starts in the Paused state, and on play, goes to the Playing state. On pause, it goes back to the Paused state. In any state, you can skip to the next track."
23+
sources={{
24+
light:
25+
'/blog/2023-10-02-what-is-a-state-machine/music-player-state-machine-light.png',
26+
dark: '/blog/2023-10-02-what-is-a-state-machine/music-player-state-machine-dark.png',
27+
}}
28+
/>
2229

2330
Specifically, it formally models how a system transitions from one state to another based on specific events (e.g., triggers, signals, changes, etc.). Think of it as a useful tool for visualizing and designing the flow of user experiences, product features, or any process you’re working on.
2431

2532
Visually, state machine diagrams are similar to flowcharts. Both use shapes to represent states (e.g., steps in a flow) and arrows to indicate transitions between those states. The main difference is that state machines are more precise, formal, and powerful than flowcharts. They’re also more flexible since you can use them to model any kind of logic, not just processes.
2633

27-
![A booking state machine with an initial idle state. From idle you can transition to car booking, flight booking, and hotel booking states.](flight-booking-state-machine.png)
34+
<ThemedImage
35+
alt="A booking state machine with an initial idle state. From idle you can transition to car booking, flight booking, and hotel booking states."
36+
sources={{
37+
light:
38+
'/blog/2023-10-02-what-is-a-state-machine/flight-booking-state-machine.png',
39+
dark: '/blog/2023-10-02-what-is-a-state-machine/flight-booking-state-machine.png',
40+
}}
41+
/>
2842

2943
State machines are a concept deeply rooted in computer science; however, they have broad applications that extend to various business domains and design disciplines. From developing intuitive software interfaces to designing effective business processes, state machines provide a structured way to model and understand complex systems. Whether you’re a product owner, project manager, designer, developer, QA tester, business analyst, or any other role, understanding state machines can significantly improve your ability to design, manage, and refine features, processes, and products.
3044

@@ -138,7 +152,14 @@ There are many key advantages of using state machines:
138152

139153
With state machine diagrams, you can visually represent the states of a process, making it easier to grasp and communicate complex logic. These diagrams bridge the communication gap between technical and non-technical team members. They also provide a clear way to document and share app logic, which you could use for onboarding new team members. After all, following boxes and arrows (just like a flowchart) is much easier than parsing code, especially for someone unfamiliar with the codebase.
140154

141-
![A mermaid diagram of our order state machine.](mermaid-order-machine-dark.png)
155+
<ThemedImage
156+
alt="A mermaid diagram of our order state machine."
157+
sources={{
158+
light:
159+
'/blog/2023-10-02-what-is-a-state-machine/mermaid-order-machine-light.png',
160+
dark: '/blog/2023-10-02-what-is-a-state-machine/mermaid-order-machine-dark.png',
161+
}}
162+
/>
142163

143164
_Our [export to Mermaid feature](/docs/export-as-code#export-formats) enables you to embed your state machines in GitHub and GitLab pull requests and comments._
144165

0 commit comments

Comments
 (0)