Skip to content

Commit

Permalink
fix: typed components update fix (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
dangreen committed Sep 20, 2022
1 parent 9c074ca commit 2a34f4f
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .size-limit.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = [
},
{
path: 'package/index.js',
limit: '1.2 KB',
limit: '1.25 KB',
import: '{ Bar }',
modifyWebpackConfig
},
Expand Down
4 changes: 3 additions & 1 deletion src/Bar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ChartJS.register(BarController);
export let chart: $$Props['chart'] = null;
let props = $$props as $$Props;
let props: $$Props;
let baseChartRef: Chart;
useForwardEvents(() => baseChartRef);
$: props = $$props as $$Props;
</script>

<Chart bind:this={baseChartRef} bind:chart type="bar" {...props} />
4 changes: 3 additions & 1 deletion src/Bubble.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ChartJS.register(BubbleController);
export let chart: $$Props['chart'] = null;
let props = $$props as $$Props;
let props: $$Props;
let baseChartRef: Chart;
useForwardEvents(() => baseChartRef);
$: props = $$props as $$Props;
</script>

<Chart bind:this={baseChartRef} bind:chart type="bubble" {...props} />
2 changes: 1 addition & 1 deletion src/Chart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
if (!chart) return;
chart.data = data;
chart.options = options;
Object.assign(chart.options, options);
chart.update(updateMode);
});
Expand Down
4 changes: 3 additions & 1 deletion src/Doughnut.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ChartJS.register(DoughnutController);
export let chart: $$Props['chart'] = null;
let props = $$props as $$Props;
let props: $$Props;
let baseChartRef: Chart;
useForwardEvents(() => baseChartRef);
$: props = $$props as $$Props;
</script>

<Chart bind:this={baseChartRef} bind:chart type="doughnut" {...props} />
4 changes: 3 additions & 1 deletion src/Line.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ChartJS.register(LineController);
export let chart: $$Props['chart'] = null;
let props = $$props as $$Props;
let props: $$Props;
let baseChartRef: Chart;
useForwardEvents(() => baseChartRef);
$: props = $$props as $$Props;
</script>

<Chart bind:this={baseChartRef} bind:chart type="line" {...props} />
4 changes: 3 additions & 1 deletion src/Pie.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ChartJS.register(PieController);
export let chart: $$Props['chart'] = null;
let props = $$props as $$Props;
let props: $$Props;
let baseChartRef: Chart;
useForwardEvents(() => baseChartRef);
$: props = $$props as $$Props;
</script>

<Chart bind:this={baseChartRef} bind:chart type="pie" {...props} />
4 changes: 3 additions & 1 deletion src/PolarArea.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ChartJS.register(PolarAreaController);
export let chart: $$Props['chart'] = null;
let props = $$props as $$Props;
let props: $$Props;
let baseChartRef: Chart;
useForwardEvents(() => baseChartRef);
$: props = $$props as $$Props;
</script>

<Chart bind:this={baseChartRef} bind:chart type="polarArea" {...props} />
4 changes: 3 additions & 1 deletion src/Radar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ChartJS.register(RadarController);
export let chart: $$Props['chart'] = null;
let props = $$props as $$Props;
let props: $$Props;
let baseChartRef: Chart;
useForwardEvents(() => baseChartRef);
$: props = $$props as $$Props;
</script>

<Chart bind:this={baseChartRef} bind:chart type="radar" {...props} />
4 changes: 3 additions & 1 deletion src/Scatter.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
ChartJS.register(ScatterController);
export let chart: $$Props['chart'] = null;
let props = $$props as $$Props;
let props: $$Props;
let baseChartRef: Chart;
useForwardEvents(() => baseChartRef);
$: props = $$props as $$Props;
</script>

<Chart bind:this={baseChartRef} bind:chart type="scatter" {...props} />

0 comments on commit 2a34f4f

Please sign in to comment.