Skip to main content

Bug Tracker

Side navigation

#13927 closed feature (wontfix)

Opened May 23, 2013 08:33AM UTC

Closed May 27, 2013 04:42PM UTC

New Callbacks.promise() method

Reported by: DzenisevichK Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

Why don't add promise method to Callbacks as in Deferred?

This method should return copy of a callback but without fire and fireWith...

Attachments (0)
Change History (1)

Changed May 27, 2013 04:42PM UTC by jaubourg comment:1

resolution: → wontfix
status: newclosed

The notion of a "promise" when it come to a Callbacks object doesn't make a lot of sense. Callbacks are low-level objects that already provide a lot and we don't intend to complexify their API even more.

Keep in mind Callbacks methods are "detachable", exactly like Deferreds methods btw. So you could create a new object with the methods you want :

function cbReadOnly( callbacks ) {
  return {
    add: callbacks.add,
    remove: callbacks.remove
  };
}