Message from JavaScript discussions

May 2017

— Why would it make a difference


There is a nodeMap which lets it remember when it saw an object before and it will not traverse into it again

— It lets it recreate any reference or cycle

— How does it remember visited nodes?

— The stack?

— Regular js map

— Oh, you reference every node in a structure, and look it up?


`var nodeMap = new Map();
nodeMap.set(obj, tuple);

— So there is a vimscript which help you migrate your react code

— notafile

— Then check with nodeMap.has(obj);

— If true, skip but still include in teration, if false, add to stack and traverse. If it was seen before the existing property of the state object will be set to the tuple of the map entry for that node

Message permanent page