Say you have three nested components. GrandParent
-> Parent
-> Child
. You have state(foo
and bar
) that lives in Grandparent
. That state is then changed by something that happens in Child
. There are two different ways to think about how to get this state to change, Event Emitting and Callback passing. I think it would be wise of us to consider switching to a callback approach rather than an Event Emitting. Primarily because I think it reduces unneccessary boilerplate and having to write logic in the "middle man" component, which in this case is the parent.
Here is the code for the two different approaches. Let me know what you think
{namespace GrandParent}
/**