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: apps/svelte.dev/content/docs/svelte/06-runtime/02-context.md
+6-15Lines changed: 6 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,27 +84,18 @@ Svelte will warn you if you get it wrong.
84
84
85
85
## Type-safe context
86
86
87
-
A useful pattern is to wrap the calls to `setContext` and `getContext`inside helper functions that let you preserve type safety:
87
+
As an alternative to using `setContext` and `getContext`directly, you can use them via `createContext`. This gives you type safety and makes it unnecessary to use a key:
0 commit comments