Skip to content

Commit

Permalink
fix(svelte): strongly type dispatched events (#1703)
Browse files Browse the repository at this point in the history
  • Loading branch information
metonym committed Dec 18, 2023
1 parent 555601a commit 1a37ef2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/svelte/src/lib/BaseChart.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@
export let ref: HTMLDivElement | null = null // reference to chart's div so parent can manipulate it
export let id = `chart-${Math.random().toString(36)}` // id for chart holder element
const dispatch = createEventDispatcher()
interface DispatchedEvents {
load: null
update: { data: ChartTabularData; options: ChartOptions }
destroy: null
}
const dispatch = createEventDispatcher<DispatchedEvents>()
onMount(() => {
try {
Expand Down

0 comments on commit 1a37ef2

Please sign in to comment.