Closed matthew-andrews closed 11 years ago
After much thought, I prefer the current version this.fire('render', { propagate: false });
. Purely because:
An aside: emit
to me seems more like a synonym of the proposed fireStatic
. Publish is something that goes to everything, and, for example 'light emitted is blocked by the first opaque thing it encounters', therefore emit
is more like fireStatic
, publish
more like fire
.
On reflection fireStatic
/fire
or the current implementation seem like the best.
There are some events that can't bubble, eg:
But custom fruit machine module events should bubble through the fruit machine structure by default.
The way this works is 0.3 is by passing in an object with a
propagate
option set to eithertrue
orfalse
.@wilsonpage and @SamGiles prefer:
As most use cases of
fireStatic
are internal anyway.I think I like:
This keeps public functions of the FruitMachine API consistently single worded (perhaps
fireStatic
doesn't need to be public?). However this has the disadvantage of requiring all existing use offire
within our fruit to be change to beemit
's.This issue can probably closed already because in balance
fireStatic
/fire
is probably the best option.