FrozenCanuck / Ki

A Statechart Framework for SproutCore
http://frozencanuck.wordpress.com
Other
105 stars 7 forks source link

Concurrent states generate duplicate events #30

Open jfgirard opened 13 years ago

jfgirard commented 13 years ago

Hi, I set a state to have 2 current sub states. When an event happen but is handled by the parent state (not by the sub states), it receive the event 2 times. It would be nice to have an option to deactivate the event forward to the parent state. Let's say a new property named "isFowardingEvent" is NO on a state, it handle the event but do not forward it if the handler method is missing.
In my example, only one of my sub state should have isFowardingEvent set to NO. The other will still forward the event to make sure the parent event receive the event. Does it make any sense ?

FrozenCanuck commented 13 years ago

Agreed. This is something that others have also brought up recently. It's becoming clear by now that although what everyone is observing is expected behavior, having a mechanism to simply specify that a state's event handler should only run once per state transition would be useful.

erichocean commented 13 years ago

+1 this is starting to bite me now too. Probably the most important issue to fix IMO; concurrent states really don't work right without it.

FrozenCanuck commented 13 years ago

Yep, this is on my plate. I had some other higher priority things to take care of first, but I'll be tackling this shortly.