Skip to content

Commit 7c8a1c9

Browse files
authored
docs: correct typo (sveltejs#405)
1 parent 74a3c29 commit 7c8a1c9

File tree

1 file changed

+1
-1
lines changed
  • content/tutorial/02-advanced-svelte/10-module-context/01-sharing-code

1 file changed

+1
-1
lines changed

content/tutorial/02-advanced-svelte/10-module-context/01-sharing-code/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Sharing code
44

55
In all the examples we've seen so far, the `<script>` block contains code that runs when each component instance is initialised. For the vast majority of components, that's all you'll ever need.
66

7-
Very occasionally, you'll need to run some code outside of an individual component instance. For example: returning to our custom audio player from a [previous exercise](media-elements), you can play all five tracks simultaneously. It would be better if playing one stopped all the others.
7+
Very occasionally, you'll need to run some code outside of an individual component instance. For example: returning to our custom audio player from a [previous exercise](media-elements), you can play all four tracks simultaneously. It would be better if playing one stopped all the others.
88

99
We can do that by declaring a `<script context="module">` block. Code contained inside it will run once, when the module first evaluates, rather than when a component is instantiated. Place this at the top of `AudioPlayer.svelte` (note that this is a _separate_ script tag):
1010

0 commit comments

Comments
 (0)