# all files / src/util/ mixin.js

90% Statements 36/40
88% Branches 22/25
100% Functions 6/6
100% Lines 6/6
3 statements, 9 branches Ignored

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    2×

    2×
    2×
    1×

    2×

     // Simple mixin utility that acts like 'extends'
    const mixin = (Parent, ...mixins) => II{
      class Mixed extends Parent {}
      for (let mixin of mixins) {
        for (let prop in mixin) {
          Mixed.prototype[prop] = mixin[prop];
        }
      }
      return Mixed;
    };

    export default mixin;