mixism
underscore mixins via interfascist
npm install mixism
What
You can add mixins to underscore for objects implementing specific interfaces via interfascist.
var Mixism = ;var Interfascist = ; var geometryInterfaces = Point: x: 'Number' y: 'Number' Line: start: 'Point' end: 'Point' ; var validator = geometryInterfaces ;var mixism = validator ;var _ = mixismunderscore; var mixins = Point: { return x: pointx * pointx y: pointy * pointy ; } { return 'Point(' + pointx + ',' + pointy + ')'; } { console; } Line: { return start: end: } { return 'Line(' + + ',' + + ')'; } { console; } ; mixism; var p = x: 5 y: 35; var l = start: p end: x: 23 y: -1 ; ;;;;/*point: Point(5,3.5)line: Line(Point(5,3.5),Point(2.3,-1))point squared: Point(25,12.25)line squared: Line(Point(25,12.25),Point(5.289999999999999,1))*/
Why
Lets you apply your mixins only to the appropriate objects.
License
MIT