MCPcopy Create free account
hub / github.com/Lobos/react-ui / setTpl

Function setTpl

src/Tree/Tree.js:91–100  ·  view source on GitHub ↗
(arr)

Source from the content-addressed store, hash-verified

89 let tt = this.props.textTpl;
90 let vt = this.props.valueTpl;
91 let setTpl = function (arr) {
92 arr.forEach((d) => {
93 d.$text = substitute(tt, d);
94 d.$value = substitute(vt, d);
95 d.$key = d.id || d.key || hashcode(`${d.$value}-${d.$text}`);
96 if (d.children) {
97 setTpl(d.children);
98 }
99 });
100 };
101 setTpl(data);
102 this.init(data, this.state.value);
103 }

Callers 1

formatDataFunction · 0.85

Calls 2

substituteFunction · 0.90
hashcodeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…