Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14378 closed feature (notabug)

Have $.noop return a resolved promise

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

$.noop = function () {

var dfd = $.Deferred(); dfd.resolve(); return dfd.promise();

};

Could be helpfull if you're asked to pass a function to pipe that needs to be "pipable" itself. But maybe it would add too much overhead.

What do you think?

Change History (1)

comment:1 Changed 6 years ago by jaubourg

Resolution: notabug
Status: newclosed

You should simply use $.when() to get a promise resolved with no argument.

Note: See TracTickets for help on using tickets.