mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-25 00:07:47 +01:00
docs: use named export instead of default (#1615)
This commit is contained in:
parent
efb69e6474
commit
40c920f184
@ -28,7 +28,7 @@ Import the provider like this in your entrypoint file (typically index.svelte):
|
|||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const proxyClientSvelte = await import('@unleash/proxy-client-svelte');
|
const proxyClientSvelte = await import('@unleash/proxy-client-svelte');
|
||||||
FlagProvider = proxyClientSvelte.default;
|
({ FlagProvider } = proxyClientSvelte);
|
||||||
});
|
});
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
@ -40,7 +40,7 @@ Import the provider like this in your entrypoint file (typically index.svelte):
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:component this="{FlagProvider}" {config}>
|
<svelte:component this={FlagProvider} {config}>
|
||||||
<App />
|
<App />
|
||||||
</svelte:component>
|
</svelte:component>
|
||||||
```
|
```
|
||||||
@ -55,7 +55,7 @@ Alternatively, you can pass your own client in to the FlagProvider:
|
|||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const proxyClientSvelte = await import('@unleash/proxy-client-svelte');
|
const proxyClientSvelte = await import('@unleash/proxy-client-svelte');
|
||||||
FlagProvider = proxyClientSvelte.default;
|
({ FlagProvider } = proxyClientSvelte);
|
||||||
});
|
});
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
@ -69,7 +69,7 @@ Alternatively, you can pass your own client in to the FlagProvider:
|
|||||||
const client = new UnleashClient(config);
|
const client = new UnleashClient(config);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:component this="{FlagProvider}" unleashClient="{client}">
|
<svelte:component this={FlagProvider} unleashClient={client}>
|
||||||
<App />
|
<App />
|
||||||
</svelte:component>
|
</svelte:component>
|
||||||
```
|
```
|
||||||
@ -82,7 +82,7 @@ By default, the Unleash client will start polling the Proxy for toggles immediat
|
|||||||
- passing a client instance to the `FlagProvider`
|
- passing a client instance to the `FlagProvider`
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<svelte:component this="{FlagProvider}" unleashClient="{client}" startClient="{false}">
|
<svelte:component this={FlagProvider} unleashClient={client} startClient={false}>
|
||||||
<App />
|
<App />
|
||||||
</svelte:component>
|
</svelte:component>
|
||||||
```
|
```
|
||||||
@ -106,7 +106,7 @@ To start the client, use the client's `start` method. The below snippet of pseud
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:component this="{FlagProvider}" unleashClient="{client}" startClient="{false}">
|
<svelte:component this={FlagProvider} unleashClient={client} startClient={false}>
|
||||||
<App />
|
<App />
|
||||||
</svelte:component>
|
</svelte:component>
|
||||||
```
|
```
|
||||||
@ -165,7 +165,7 @@ Follow the following steps in order to delay rendering until the flags have been
|
|||||||
{#if !$flagsReady}
|
{#if !$flagsReady}
|
||||||
<Loading />
|
<Loading />
|
||||||
{:else}
|
{:else}
|
||||||
<MyComponent error="{flagsError}" />
|
<MyComponent error={flagsError} />
|
||||||
{/if}
|
{/if}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -193,4 +193,4 @@ Follow the following steps in order to update the unleash context:
|
|||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
```
|
```
|
||||||
|
Loading…
Reference in New Issue
Block a user