3 ms·
I'm not sure if I'm following... we've got: EA -> HA + HB HA -> EB -> HC With HC expecting HB to have run. My reaction would be "don't do that". If HC
by andreyf 18y ago
I'm not sure if I'm following... we've got:
EA -> HA + HB
HA -> EB -> HC
With HC expecting HB to have run. My reaction would be "don't do that". If HC relies on HB completing, either put in a check in HC and keep trying until the environment is right (write a higher-order function if you're doing it often), or (better!) make your event system handle the logic you are trying to describe: HC is triggered when both HA and HB complete, like so:
EA -> HA + HB
HA -> EB
HB -> EC
EB + EC -> HC
This is all trivial in JS, since handlers are just functions assigned to variables!