Closed Danappelxx closed 7 years ago
Actually, something that I just noticed is that machine <- event
returns the same machine. Is the intention to allow chains like machine <- event1 <- event2 <- event3
? In that case event3 => event2 => event1 => machine
does look quite messy...
Sorry for late response.
<-
is used similar way as Golang's Chan
, basically means "setter" and used in many other langs/libs.
BTW, you can do like machine <- event1 <- event2 <- event3
if you want, and it's intentionally designed as so.
(But in any case, it becomes messy...)
This issue is a very non-issue but... shouldn't
machine <- event
beevent -> machine
? Code is naturally read from left to right (at least, in english code).The only reason I can think of to not use
->
is because it is a reserved Swift operator. Instead, why not reuse the=>
operator that is already declared and used in the project to describe state transitions?