Message from JavaScript discussions

February 2018

— I think making a class usable with the

new
keyword is more or less the same route

— 

You already sort of have to do this with the search iterations when using them directly instead of a strategy

— They are instantiated as generators, with some important arguments being fed into them via the

state
object after initialization

Message permanent page

— Ie

const myGen = dfs(myObj);
var state = myGen.next();
state.arguments.thing = 123;
state.tuple.extraObj = myObj2;

Message permanent page

— And yes, anything added to state.tuple is automatically traversed in parallel

— If state.tuple.otherObj matches the structure of state.tuple.search, then you can safely assume state.tuple.otherObj[state.accessor] exists. If not, it drops objects from the tuple since it can’t figure out how to sync them up for that particular part of the graph structure

Message permanent page

— So with that in mind, the userspace code could also do dependency injection this way, including whitelist and blacklist, using custom properties

Message permanent page

— It's just all so much more code for just 1 more parameter though

— The problem with feature detection is that you can't know if the root properties like whitelist are part of the search index or not...

Message permanent page

— So it would be a required root property, no assumptions allowed

— And yeah I totally stress out over these interfaces lol

— Very optimistic coding style🤤