thunderous 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +23 -21
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thunderous",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
package/readme.md CHANGED
@@ -21,31 +21,33 @@ npm install thunderous
21
21
 
22
22
  ## Usage
23
23
 
24
- Below is a basic usage of the functions available.
24
+ Below is a basic usage of the `customElement` function.
25
25
 
26
26
  ```ts
27
27
  import { customElement, html, css, createSignal } from 'thunderous';
28
28
 
29
- const MyElement = customElement(({ attrSignals, connectedCallback, refs, adoptStyleSheet }) => {
30
- const [heading] = attrSignals.heading;
31
- const [count, setCount] = createSignal(0);
32
- connectedCallback(() => {
33
- refs.increment.addEventListener('click', () => {
34
- setCount(count() + 1);
35
- });
36
- });
37
- adoptStyleSheet(css`
38
- :host {
39
- display: block;
40
- font-family: sans-serif;
41
- }
42
- `);
43
- return html`
44
- <h2>${heading}</h2>
45
- <button ref="increment">Increment</button>
46
- <output>${count}</output>
47
- `;
48
- });
29
+ const MyElement = customElement(
30
+ ({ attrSignals, connectedCallback, refs, adoptStyleSheet }) => {
31
+ const [heading] = attrSignals.heading;
32
+ const [count, setCount] = createSignal(0);
33
+ connectedCallback(() => {
34
+ refs.increment.addEventListener('click', () => {
35
+ setCount(count() + 1);
36
+ });
37
+ });
38
+ adoptStyleSheet(css`
39
+ :host {
40
+ display: block;
41
+ font-family: sans-serif;
42
+ }
43
+ `);
44
+ return html`
45
+ <h2>${heading}</h2>
46
+ <button ref="increment">Increment</button>
47
+ <output>${count}</output>
48
+ `;
49
+ },
50
+ );
49
51
 
50
52
  MyElement.define('my-element');
51
53
  ```