News for hackers. Stuff that matters.
Re:Show HN: Ex-machina – Minimalist state machine in JavaScript by mgold on Monday June 29, 2015 @09:08AM (#9797785)
It wasn't immediately clear to me, but this library tracks both the state (e.g. "state1") and a payload, some arbitrary value. This already seems like two separate concerns?

As for transitions, it seems that each state has a collection of functions for every other state, which are called with the payload to determine if that state should be transitioned into. This seems error-prone - if there's no transition, is that the end or an error? If there are multiple, how do you choose?

It also seems that the state machine will run immediately to completion unless you return a promise payload. (Bluebird? ES6? It doesn't say.) So if you want a reactive document, this doesn't seem like a fit.

Re:Show HN: Ex-machina – Minimalist state machine in JavaScript by yoshuaw on Saturday June 27, 2015 @04:57PM (#9791513)
Oh hey, I also built a JS state machine a while back. Nice to see other implementations around! :D - https://github.com/yoshuawuyts/fsm-event
Re:Show HN: Ex-machina – Minimalist state machine in JavaScript by harlowja on Saturday June 27, 2015 @01:55PM (#9790939)
Re:Show HN: Ex-machina – Minimalist state machine in JavaScript by ddrum001 on Saturday June 27, 2015 @01:46PM (#9790905)
Could the OP or the Github Readme explain why this is called Ex-Machina...
Re:Show HN: Ex-machina – Minimalist state machine in JavaScript by JadeNB on Saturday June 27, 2015 @02:23PM (#9791050)
Because the creator's a fan of Alex Garland? (EDIT: I think too that "out of the machine" is not a terrible, if also not a terribly enlightening, description of how a state machine makes decisions.)
Re:Show HN: Ex-machina – Minimalist state machine in JavaScript by robinbressan on Saturday June 27, 2015 @03:10PM (#9791209)
In fact there is no reason. I needed it quickly for another project and the common names was already taken on npm.
Re:Show HN: Ex-machina – Minimalist state machine in JavaScript by ddrum001 on Sunday June 28, 2015 @07:00PM (#9795475)
Thanks...makes sense now.