Skip to content

Commit 9ecbe64

Browse files
committed
docs are unnecessary here
1 parent 09b53f5 commit 9ecbe64

File tree

1 file changed

+2
-28
lines changed

1 file changed

+2
-28
lines changed

packages/svelte/src/internal/server/context.js

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ import { on_destroy } from './index.js';
55
export var current_component = null;
66

77
/**
8-
* Retrieves the context that belongs to the closest parent component with the specified `key`.
9-
* Must be called during component initialisation.
10-
*
11-
* https://svelte.dev/docs/svelte#getcontext
128
* @template T
139
* @param {any} key
1410
* @returns {T}
@@ -21,13 +17,6 @@ export function getContext(key) {
2117
}
2218

2319
/**
24-
* Associates an arbitrary `context` object with the current component and the specified `key`
25-
* and returns that object. The context is then available to children of the component
26-
* (including slotted content) with `getContext`.
27-
*
28-
* Like lifecycle functions, this must be called during component initialisation.
29-
*
30-
* https://svelte.dev/docs/svelte#setcontext
3120
* @template T
3221
* @param {any} key
3322
* @param {T} context
@@ -39,25 +28,14 @@ export function setContext(key, context) {
3928
}
4029

4130
/**
42-
* Checks whether a given `key` has been set in the context of a parent component.
43-
* Must be called during component initialisation.
44-
*
45-
* https://svelte.dev/docs/svelte#hascontext
4631
* @param {any} key
4732
* @returns {boolean}
4833
*/
4934
export function hasContext(key) {
5035
return getAllContexts().has(key);
5136
}
5237

53-
/**
54-
* Retrieves the whole context map that belongs to the closest parent component.
55-
* Must be called during component initialisation. Useful, for example, if you
56-
* programmatically create a component and want to pass the existing context to it.
57-
*
58-
* https://svelte.dev/docs/svelte#getallcontexts
59-
* @returns {Map<any, any>}
60-
*/
38+
/** @returns {Map<any, any>} */
6139
export function getAllContexts() {
6240
const context = current_component;
6341

@@ -72,11 +50,7 @@ export function getAllContexts() {
7250
}
7351

7452
export function push() {
75-
current_component = {
76-
p: current_component,
77-
c: null,
78-
d: null
79-
};
53+
current_component = { p: current_component, c: null, d: null };
8054
}
8155

8256
export function pop() {

0 commit comments

Comments
 (0)