One of the simplest ways I know to make a function/method more reusable is dependency injection. Instead of relying on `this`, pass the dependency into the function as an argument and call the methods on that parameter instead.
-
-
To add to the benefits list, linters can't pick up mistakes when using `this`. It doesn't know you misspelled `this.databaes`
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
%. I haven't written `class` or `this` more than a handful of times in the last few years.