API consistency between Front and TargetList
Fronts have onFront(type, callback)
, offFront(type, callback)
.
The TargetList has listen(type, createCallback, destroyCallback)
and unlisten(type, createCallback, destroyCallback)
.
The two APIs seem to care about similar lifecycles, so it would be great if the API had a similar shape. Having a single method with 2 callbacks means all consumers need to attach their listeners for creation and destruction at the same spot. It might not be flexible enough in all situations?
Proposal 1: