Decorators

Just looked up decorators, they’re cool. I take back anything bad I said about closure.

The TL;DR is that you make your outer function take a function, thats called in the inner function, along with doing some other stuff, and then you assign the new function to the old functions name so when you call the old function is calls the function along with the added functionality it got from replacing it with the inner function. So it decorates the function with some new things, while still doing what it already did.

Leave a comment