Skip to content
This repository has been archived by the owner on Aug 10, 2020. It is now read-only.

Latest commit

 

History

History
4 lines (3 loc) · 533 Bytes

mixin.md

File metadata and controls

4 lines (3 loc) · 533 Bytes

Module - mixin.js

This module allows for methods and properties to be shared between objects while retaining class inheritance for syntax.

The method of mixins differs from MDN's example of mixins and instead uses Object.assign() and Object.defineProperties() to both the prototype and constructor. The function allows for the mixins to be require()'ed and called with this bound to the object to add to for easy-to-understand syntax.