Message from JavaScript discussions

May 2017

— Ohh... this is a hellish amount of state... all live and external too

function newIterationState () {
return {
continue: true,
skipNode: false,
tuple: {},
iterations: 0,
length: 0,
existing: null,
isContainer: false,
invertedIndex: false,
isLast: false,
isFirst: true,
loc: null
};
}

Message permanent page

— 

var alg = new Strategy(iddfs);
alg.addObserver(observerCallbacks.diff);
alg.addObserver(observerCallbacks.clone);
alg.dependency = {
originalRoot: myObj,
returnDiff: false,
};
return alg.run(obj1Root, searchRoot);

— Managed to built an algorithm strategy framework, but I think it breaks some rules!! All the strategies pre-empt the search algorithm generator and each other mid execution, by directly changing it's state...

Message permanent page

— Is this an okay exception? My surface area is the iterator protocol, so next and value

— I posted in here earlier when it was not so fleshed out, but now I got it working! But so shamefully breaking encapsulation!

Message permanent page

— What does new Strategy mean?

— Oh god

— I'm not sure what this means 😅

— It is the strategy design pattern

— In this case a strategy interfaces with an iterator/generator yielding that state object

— It is tightly coupled with it

— Async iteration is confirmed in a future version of js now btw