@storybook/addon-svelte-csf 4.0.8 → 4.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,6 +10,8 @@ export function createRenderContext(props = {}) {
|
|
|
10
10
|
args: {},
|
|
11
11
|
...props,
|
|
12
12
|
});
|
|
13
|
+
// reset the component context
|
|
14
|
+
resetStoryRenderContext();
|
|
13
15
|
}
|
|
14
16
|
export function createRegistrationContext(repositories) {
|
|
15
17
|
setContext(CONTEXT_KEY, {
|
|
@@ -30,9 +32,12 @@ export function useContext() {
|
|
|
30
32
|
}
|
|
31
33
|
return getContext(CONTEXT_KEY);
|
|
32
34
|
}
|
|
35
|
+
function resetStoryRenderContext() {
|
|
36
|
+
setContext(CONTEXT_KEY_COMPONENT, { argsStore: writable({}), storyContextStore: writable({}) });
|
|
37
|
+
}
|
|
33
38
|
export function getStoryRenderContext() {
|
|
34
39
|
if (!hasContext(CONTEXT_KEY_COMPONENT)) {
|
|
35
|
-
|
|
40
|
+
resetStoryRenderContext();
|
|
36
41
|
}
|
|
37
42
|
return getContext(CONTEXT_KEY_COMPONENT);
|
|
38
43
|
}
|