Skip to main content

Bug Tracker

Side navigation

#14593 closed feature (worksforme)

Opened November 29, 2013 05:19PM UTC

Closed December 19, 2013 09:13PM UTC

cannot merge callbacks: jQuery.Callbacks().add( jQuery.Callbacks() )

Reported by: obradovic.miroslav@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc: jaubourg
Blocked by: Blocking:
Description

jQuery.Callbacks().add() can add either a function or an array of functions, but it still does not treat another jQuery.Callbakcs() as a list of callbacks that can be added

Attachments (0)
Change History (5)

Changed December 19, 2013 07:10PM UTC by timmywil comment:1

cc: → jaubourg

Jaubourg, what do you think of this feature? I could see it being useful, but I imagine it could require more than trivial changes to the source (because the list is currently inaccessible by another jQuery.Callbacks()).

Changed December 19, 2013 07:20PM UTC by anonymous comment:2

imlementing inverted logic is good enough, eg. method

var c1, c2; // jQuery.Callbacks()

c1.addAllTo(c2)

so c1 would add its callback array to c2

Changed December 19, 2013 07:46PM UTC by jaubourg comment:3

I fail to see the gain here. I'd expect c1.add( c2.fire ); to cover any use case.

Changed December 19, 2013 08:57PM UTC by obradovic.miroslav@gmail.com comment:4

Good point. That was all I needed, just didn't see it so far. Can be closed as invalid. Would be useful to add an example to api.jquery.com

Changed December 19, 2013 09:13PM UTC by jaubourg comment:5

resolution: → worksforme
status: newclosed

Since there's something in the API that (sorta) does it already, let's close this as worksforme ;)