[wp-trac] [WordPress Trac] #38947: Proposition to add an optimized api.Events manager to the api.Value constructor

WordPress Trac noreply at wordpress.org
Sat Nov 26 11:21:37 UTC 2016


#38947: Proposition to add an optimized api.Events manager to the api.Value
constructor
-------------------------+-----------------------------
 Reporter:  nikeo        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Customize    |    Version:  trunk
 Severity:  normal       |   Keywords:
  Focuses:  javascript   |
-------------------------+-----------------------------
 It would be convenient to be able to bind, unbind and trigger `api.Value`
 instances by event id, instead of using only functions param like it's the
 case now.

 The `api.Values` constructor is already extended with the `api.Events`
 manager object, which is very useful. I propose to do something similar
 with the `api.Value` constructor.

 In order to not overload the `api.Value.topics` object with anonymous
 functions, a possible optimization would be to fallback on the previous
 binding method of `api.Value`, with a function type param directly added
 to the `api.Value.callbacks` ( `$.Callbacks` ) object, if no id is
 provided for the callback, and to populate the `api.Value.topics` property
 only when an id has been provided on binding.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/38947>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list