Message from JavaScript discussions
February 2018
— I think making a class usable with the
newkeyword 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
stateobject after initialization
— Ie
const myGen = dfs(myObj);
var state = myGen.next();
state.arguments.thing = 123;
state.tuple.extraObj = myObj2;
— 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
— So with that in mind, the userspace code could also do dependency injection this way, including whitelist and blacklist, using custom properties
— 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...
— 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🤤