Skip to content

Commit

Permalink
feat(HandledPromise): add applyFunction static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelfig committed Oct 11, 2019
1 parent ff5f10e commit 4f0e4bf
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,20 @@ export function makeHandledPromise(EPromise) {
deleteSendOnly(target, key) {
EPromise.resolve(target).delete(key);
},
// TODO: Change HandledPromise.apply to be
// HandledPromise.applyFunction
// to avoid conflict with constructor .apply behaviour.
// TODO: Remove when making HandledPromise a constructor
// to avoid conflict with Function.prototype.apply
apply(target, args) {
return EPromise.resolve(target).post(undefined, args);
},
applySendOnly(target, args) {
EPromise.resolve(target).post(undefined, args);
},
applyFunction(target, args) {
return EPromise.resolve(target).post(undefined, args);
},
applyFunctionSendOnly(target, args) {
EPromise.resolve(target).post(undefined, args);
},
applyMethod(target, key, args) {
return EPromise.resolve(target).post(key, args);
},
Expand Down

0 comments on commit 4f0e4bf

Please sign in to comment.