—
var myAlg = new Strategy(null,
function (state) {
console.log(state);
}
);
myAlg.traverseAlg = function* (object) {
for (var loc in object) {
yield object[loc];
}
};
myAlg.run({property: "Hello World!"});
bam
— Needs some tweaking, but this is looking nice
— Allows decoupled behavior from the main algorithm
— I have no clue what that means, but it sounds cool.
— Im sure I can get this more efficient, but here it is https://github.com/Floofies/Differentia.js/blob/master/differentia.js#L200
Message permanent page
— Nice, didn't have github link before
— Https://www.npmjs.com/package/differentia
— Doesn't even have to be published on npm