Skip to content

Commit

Permalink
fix(util): improve performance of classToInvokable (#10534)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSchick authored and sushantdhiman committed Mar 11, 2019
1 parent a26193a commit f862e6b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/utils/classToInvokable.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ function classToInvokable(Class) {
return new Proxy(Class, {
apply(Target, thisArg, args) {
return new Target(...args);
},
construct(Target, args) {
return new Target(...args);
},
get(target, p) {
return target[p];
}
});
}
Expand Down

0 comments on commit f862e6b

Please sign in to comment.