How to use the solid-js.createSignal function in solid-js

To help you get started, we’ve selected a few solid-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github krausest / js-framework-benchmark / frameworks / keyed / solid-signals / src / main.jsx View on Github external
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 =&gt; (
<table class="table table-hover table-striped test-data"><tbody>
      </tbody></table></div>
github krausest / js-framework-benchmark / frameworks / keyed / solid-signals / src / main.jsx View on Github external
function buildData(count) {
  let data = new Array(count);
  for (let i = 0; i &lt; 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;
}
github vogloblinsky / web-components-benchmark / pascal-triangle / solid / src / pascal-triangle.jsx View on Github external
const PascalTriangle = () =&gt; {
  const [list, setList] = createSignal(generateData(_length)),
    handleLoad = ({ target }) =&gt; {
      let length = parseInt(target.getAttribute('data-value'));
      setList(generateData(length));
    };

  return (&lt;&gt;
    <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 =&gt;
      <div>{line.map( item =&gt;
        
      )}</div>
    ))}</div>

solid-js

A declarative JavaScript library for building user interfaces.

MIT
Latest version published 1 month ago

Package Health Score

94 / 100
Full package analysis