MCPcopy Create free account
hub / github.com/krausest/js-framework-benchmark / create

Function create

frameworks/keyed/uhtml/src/utils.js:15–28  ·  view source on GitHub ↗
(count, add)

Source from the content-addressed store, hash-verified

13// creats rows but it keep track of created data so
14// that it's possible to modify it and reflect next time it's needed
15export const create = (count, add) => {
16 if (count < 1) {
17 if (count < 0) return DATA;
18 else TR = null;
19 }
20 if (add) count += SIZE;
21 else DATA = [];
22 for (let i = add ? SIZE : 0; i < count; i++) {
23 const id = ID++;
24 DATA[i] = { id, label: label(), selected: SEL === id };
25 }
26 SIZE = count;
27 return DATA;
28};
29
30// create once a handler that keep data state updated
31// by selecting something or removing it

Callers 1

jumbotron.jsFile · 0.90

Calls 1

labelFunction · 0.70

Tested by

no test coverage detected