Skip to content

Commit

Permalink
cockpit.js: Put back cockpit.{resolve,reject}
Browse files Browse the repository at this point in the history
Commit 132300e was premature, subscription-manager still uses
that [1]. Put it back, but in terms of the standard Promise API.

[1] candlepin/subscription-manager-cockpit#84
  • Loading branch information
martinpitt committed Nov 25, 2024
1 parent 4aa8fb3 commit 3a12adf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/lib/cockpit.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ function factory() {
},
};

cockpit.resolve = function resolve(result) {
return Promise.resolve(result);
};

cockpit.reject = function reject(ex) {
return Promise.reject(ex);
};

cockpit.defer = function() {
return new Deferred();
};
Expand Down

0 comments on commit 3a12adf

Please sign in to comment.