Browse Source

Clean-up counter example

master
Nicolas Petton 1 year ago
parent
commit
55495f7b95
No known key found for this signature in database GPG Key ID: E8BCD7866AFCF978
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      examples/counter.js

+ 1
- 2
examples/counter.js View File

@ -1,9 +1,8 @@
import component from "../src/component.js";
import { useState, useAttribute } from "../src/hooks.js";
let counter = component("x-counter", ({ count = 0, val = 2 } = {}) => html => {
let counter = component("x-counter", ({ count = 0 } = {}) => html => {
let [currentCount, setCount] = useState(count);
let [currentVal, setVal] = useState(val);
html.h2(currentCount);
html.button({ click: () => setCount(currentCount + 1) }, "++");


Loading…
Cancel
Save