You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sites/svelte-5-preview/src/routes/docs/content/02-examples/01-universal-reactivity.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ Suppose we have a component like this:
15
15
}
16
16
</script>
17
17
18
-
<button on:click={increment}>
18
+
<button onclick={increment}>
19
19
clicks: {count}
20
20
</button>
21
21
```
@@ -40,9 +40,9 @@ We can encapsulate this logic in a function, so that it can be used in multiple
40
40
+ const counter = createCounter();
41
41
</script>
42
42
43
-
-<button on:click={increment}>
43
+
-<button onclick={increment}>
44
44
- clicks: {count}
45
-
+<button on:click={counter.increment}>
45
+
+<button onclick={counter.increment}>
46
46
+ clicks: {counter.count}
47
47
</button>
48
48
```
@@ -78,12 +78,12 @@ export function createCounter() {
78
78
const counter = createCounter();
79
79
</script>
80
80
81
-
<button on:click={counter.increment}>
81
+
<button onclick={counter.increment}>
82
82
clicks: {counter.count}
83
83
</button>
84
84
```
85
85
86
-
[See this example in the playground.](/#H4sIAAAAAAAACmVQ0U7DMAz8FStC2iaqDl67dhLiMxgPI3NRRutUiYNAVf6dJG1TBk-W7bvznUfRqg6tqF5GQeceRSWehkEUgr-H2NhP7BhDb7UzMk5qK40a-HiiE6t-0IZhBGnwzPisHTEa8NAa3cOm3MtpUk4y5dVuDoEXmFKTZZjX0NwKbHcBVe_XQ1S_OWZNoKmSnZIfzbgoKwrUHol9cpS2toK8T9VHuUniGLL0-qJahRdRsXHoixz91u76hav9_QH8SqlbR5JVMPXHO4zRSIdzvBDuznIAbB92c_jMzOYXVnxM5Nw38BjB0XksBtkZWjDvi_ZKy5A0P0xDX0w1n0mKYen_P-HV_wBwv1jcCwIAAA==)
86
+
[See this example in the playground.](/#H4sIAAAAAAAAE2VQ0U7DMAz8FStC2iaqDl67dhLiMxgPI3NRRutUiYNAVf6dJG1TBk-W7bvznUfRqg6tqF5GQeceRSWehkEUgr-H2NhP7BhDb7UzMk5qK40a-HiiE6t-0IZhBGnwzPisHTEa8NAa3cOm3MtpUk4y5dVuDoEXmFKTZZjX0NwKbHcBVe_XQ1S_OWZNoEl2Sn404yKsKDB7JPbJUNraCvI-VR_VJoVjiNLri2oVXkTFxqEvcvJbt-sTrvb3A_ArhW4dSVbB0x_rMEYjHc7pQrY7ywGwfdjN2TMzm19Y8S-Rc9_AYwRH57EYZGdowbwv2istQ9L8MA19MdV8JimGpf__hFf_Ay1mGDQKAgAA)
87
87
88
88
## Stores equivalent
89
89
@@ -115,7 +115,7 @@ Back in the component, we retrieve the store value by prefixing its name with `$
0 commit comments