Skip to content

Commit 94d2e18

Browse files
committed
refactor: remove workaround for this.constructor
1 parent f78491f commit 94d2e18

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

index.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
export class Base {
22
constructor(options = {}) {
33
this.options = options;
4-
// apply plugins
5-
// https://stackoverflow.com/a/16345172
6-
const classConstructor = this.constructor;
7-
classConstructor.plugins.forEach((plugin) => {
4+
this.constructor.plugins.forEach((plugin) => {
85
Object.assign(this, plugin(this, options));
96
});
107
}
8+
119
static plugin(plugin1, ...additionalPlugins) {
1210
var _a;
1311
const currentPlugins = this.plugins;

0 commit comments

Comments
 (0)