Skip to content

Commit 74a3c29

Browse files
pedroldkdummdidumm
andauthored
docs: Update text in Sharing code tutorial (sveltejs#401)
--------- Co-authored-by: Simon H <[email protected]>
1 parent 375f55d commit 74a3c29

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
@@ -6,7 +6,7 @@ In all the examples we've seen so far, the `<script>` block contains code that r
66

77
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.
88

9-
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`:
9+
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

1111
```svelte
1212
/// file: AudioPlayer.svelte

0 commit comments

Comments
 (0)