bitfocus / io.bitfocus.companion-plugin

Companion plugin for the native Stream Deck application
MIT License
6 stars 3 forks source link

refactor: fix code style and typos #1

Closed fmalcher closed 1 year ago

fmalcher commented 4 years ago

Open questions

I'd recommend to refactor the following, but I did not know whether you had a good reason for them.

Checks for undefined

You often do checks for undefined values like this:

if (listeners[key] === undefined) {
  return;
}

Is there a specific reason why you soecifically check for undefined and not for truthyness/falsyness?

if (!listeners[key]) {
  return;
}

const self = this

Each function has a self variable to save the this context of the function – fair enough! However, this would not be necessary if you used arrow functions all the way for the inner functions. Is there a reason why you chose to do so?

krocheck commented 3 years ago

@haakonnessjoen do we want to move forward with this?