1
Custom Event Infrastructure Change History
2
==========================================
7
* onceAfter (added in 3.4.0) now works for array and object signatures.
13
* Custom events published from `Y` no longer bubble by default.
18
* Undocumented and poorly named `each()` method on EventHandle changed to
21
* After listeners for events fired in a `defaultFn` or listener are queued in
24
* Added `Y.Do.originalRetVal` and `Y.Do.currentRetVal` statics accessible by
25
`Y.Do.after()` subscribers.
27
* Exposed the previously private `EventTarget.parseType`.
32
* Fixed `defaultTargetOnly` publish configuration.
34
* `detach()` now decrements `subCount`/`afterCount`.
36
* Detaching via category no longer affects subscriptions on other objects.
46
* Wildcard prefix subscriptions supported: `target.on('*:click', …)` will be
47
notified when `tree:click`, `tab:click`, etc are fired.
49
* Added `EventTarget::once`, which is equivalent to `on()`, except the
50
listener automatically detaches itself once executed.
52
* Added event monitoring. When configured, an `EventTarget` will emit events
53
for `publish()`, `attach()`, `fire()`, and `detach()` operations on the
56
* `EventTarget::on`'s `type` parameter is overloaded to accept arrays and
57
objects for attaching multiple types at once.
59
* `EventTarget::detach` returns the event target like the API docs already
62
* Events can now be configured to execute the `defaultFn` only on the targeted
63
object, not on the bubble targets.
65
* The event order has been reworked so that the after listeners for the entire
66
event stack execute after all `defaultFn` across the entire bubble stack.
71
* Broken into core base and complex modules.
73
* `broadcast` works for simple events.
75
* If configured to return an `EventHandle`, the return value will always be a
76
single object, regardless of how many listeners were attached. Previously,
77
multiple listeners provided an array of detach handles.
82
* [!] Exposed methods are `on()` for the before moment, `after()` for the
83
after moment, and `detach()` for unsubscribe. `subscribe()`, `before()`,
84
`unsubscribe()`, and corresponding methods are deprecated.
86
* Implemented the `broadcast` flag:
88
* `broadcast = 1`: local, accessible via `Y.on('prefix:event')`.
89
* `broadcast = 2`: global, accessible via `Y.on()` or globally via
90
`Y.Global.on('prefix:event')`.
92
Broadcast listeners cannot effect the `defaultFn` or host subscribers (so
93
are in effect, after listeners), although this is still possible by added
94
either `Y` or `Y.Global` as `EventTarget`s.
96
* Moved `event-custom` out of `event` package.
98
* `EventTarget` accepts a `prefix` configuration. This is used in all exposed
99
methods to handle shortcuts to event names, e.g., `'click'` and
100
`'menu:click'` are the same if the prefix is `'menu'`.
102
* Event type accepts a event category which can be used to detach events:
104
Y.on('category|prefix:event', fn);
105
Y.detach('category|prefix:event');
106
Y.detach('category|*');
108
* Added `chain` config to events that makes the return value the event target
109
rather than a detach handle. Use with the detach category prefix.
111
* The `type` parameter can be an object containing multiple events to attach:
113
Y.on({ 'event1': fn1, 'event2': fn2 });
115
* `Y.fire` payload for event facades can be another facade or a custom event.