Extract refactor

It's common to realize that a certain block of code is going to be used in multiple places. When you realize that, you usually want to extract this code into it's own method. VS Code includes an "Extract Method" refactoring tool to make this easier.

Extract the code in the connection.on method inside the constructor into a method called updateColor

Last updated