Famous / Famous/engine

Dispatch overridden w/ side effects when child emits new program event.

Open
#365 7 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
1.7k
Forks
249
PR merge metrics
No merged PRs in 30d

Description

If an event (event alpha) is currently being processed (i.e. the Breath First Search is ongoing) for a particular _program_ event via Dispatch, and a child node's (node X) handling of this event creates a _new_ program event (event beta) targeted at the path of its own node, then this event will 'take over' the event Dispatch, but keep the remaining children in the queue. This results in event beta being sent to the neighbours of node X and not simply its children.

The following JSBin demonstrates this problem: https://jsbin.com/toroqaheze/edit (needs local images, but effect can still be seen).

To reproduce:
1,2,3,4 will change the speed of spinning of each child, but 3 will emit a new event (.hide()) as well, this overrides the currently processed event (speedChange) and the 4th node's speed is not changed.

Gist is here: https://gist.github.com/anonymous/e9f45883faad8540ff66

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.