JSFiddle - React, Tailwind, and code Playground

JavaScript

function MyPlugin() {
  this.hello = 'hello'
  document.addEventListener('click', this.clickedBinded);
  this.clickedBinded('e');
}

MyPlugin.prototype.clickedBinded = clicked.bind(this);

function clicked(e) {
  console.log(this.hello, e);
}

var plugin1 = new MyPlugin();