Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const App = () => {
let rowId;
const [data, setData] = createSignal([]),
[selected, setSelected] = createSignal(null, (a, b) => a === b),
applySelection = selectWhen(selected, 'danger');
return <div class="container">
<div class="jumbotron"><div class="row">
<div class="col-md-6"><h1>SolidJS Keyed</h1></div>
<div class="col-md-6"><div class="row">
<button id="run">
</button><button id="runlots">
</button><button id="add">
</button><button id="update">
</button><button clear="">
</button><button id="swaprows">
</button></div></div>
</div></div>
{ row => (
<table class="table table-hover table-striped test-data"><tbody>
</tbody></table></div>
function buildData(count) {
let data = new Array(count);
for (let i = 0; i < count; i++) {
const [label, setLabel] = createSignal(`${adjectives[_random(adjectives.length)]} ${colours[_random(colours.length)]} ${nouns[_random(nouns.length)]}`);
data[i] = {
id: idCounter++,
label, setLabel
}
}
return data;
}
const PascalTriangle = () => {
const [list, setList] = createSignal(generateData(_length)),
handleLoad = ({ target }) => {
let length = parseInt(target.getAttribute('data-value'));
setList(generateData(length));
};
return (<>
<div>
<button data-value="10">Load 10</button>
<button data-value="100">Load 100</button>
<button data-value="500">Load 500</button>
</div>
<div>{(list().map( line =>
<div>{line.map( item =>
)}</div>
))}</div>