One is the idea of a hook that only fires the next time you hit some specific state. The example they gave was of a car waiting at a traffic light, rather than the light itself, wanting to know when next-green hits so that it could proceed.
This is a good idea, but it has some mismatch with the current API.
It's not clear if this is actually a hook or not.
It could be cast as another hook variant set, but do we really want hook_post_entry_once? API proliferation sucks.
It could be a config argument passed to a hook
If it is a hook
Hooks are unitary - hook something and the old hook is removed. This wouldn't want to be, which is a conflict
Should these remove hooks, even though they're going away?
If it isn't a hook
Why is it shaped so much like a hook
What do we call it
Either way
Is this just transitions, or also actions
If you action a 'foo' -> b, does the one-time fire? Hooks wouldn't, but it seems like this ought to
Does this do other things, like next error, next tape, etc?
Saw a good comment criticizing XState on Reddit. Reached out to its author
u/tossed_
to ask about opinions.They dropped several good new features.
One is the idea of a hook that only fires the next time you hit some specific state. The example they gave was of a car waiting at a traffic light, rather than the light itself, wanting to know when next-green hits so that it could proceed.
This is a good idea, but it has some mismatch with the current API.
hook_post_entry_once
? API proliferation sucks.a 'foo' -> b
, does the one-time fire? Hooks wouldn't, but it seems like this ought to