Skip to content

Commit 6f7befc

Browse files
authored
Update README for clarity and code example
1 parent 157beb6 commit 6f7befc

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

readme.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
# [](https://dy.github.io/sprae) spræ
22

3-
Microhydration for DOM tree with signals-based reactive attributes.
3+
Microhydration for DOM tree with signals-based attributes.
44

55
```html
66
<div id="counter" :scope="{count: 1}">
77
<p :text="`Clicked ${count} times`"></p>
88
<button :onclick="count++">Click me</button>
99
</div>
1010

11-
<script src="https://unpkg.com/sprae" start="#counter"></script>
11+
<script type="module">
12+
import sprae from '//unpkg.com/sprae?module'
13+
14+
const state = sprae(document.getElementById('counter'), { count: 0 })
15+
state.count++
16+
</script>
1217
```
1318

1419
[`:text`](docs.md#text) [`:class`](docs.md#class) [`:style`](docs.md#style) [`:value`](docs.md#value) [`:<attr>`](docs.md#attr-) [`:if :else`](docs.md#if-else) [`:each`](docs.md#each) [`:scope`](docs.md#scope) [`:fx`](docs.md#fx) [`:ref`](docs.md#ref) [`:on<event>`](docs.md#onevent)
@@ -31,7 +36,7 @@ Micro sprae version is 2.5kb bundle with essentials:
3136

3237
## why
3338

34-
Simple reactivity without overhead. Perfect for SPA.<br>
39+
Simple practical reactivity without overhead. Perfect for SPA.<br>
3540
Inspired by [alpine](https://github.com/alpinejs/alpine), [petite-vue](https://github.com/vuejs/petite-vue) and others. <!--[lucia](https://github.com/aidenybai/lucia), [nuejs](https://github.com/nuejs/nuejs), [hmpl](https://github.com/hmpl-language/hmpl), [unpoly](https://unpoly.com/up.link), [dagger](https://github.com/dagger8224/dagger.js)-->
3641

3742

0 commit comments

Comments
 (0)