Pure Javascript Mixins
Wednesday, March 3rd, 2010I’ve been working on some javascript projects and wanted to be able have mixins, since I have some standard functionality that I use in all my classes, but the functionality suited being a mixin more than using prototype based class inheritance. I don’t need any fancy inheritance chaining - or ability to do typeof on the instances, so I wanted something simple and easy. This is what I got… (including tests for node.js):
