carbon-components-svelte/tests/ImageLoader.test.svelte
metonym 714f47a635
fix(types): dispatched events without a detail value should be null (#1124)
Currently, dispatched events without `e.detail` have a type of `any`.

We can be more specific as a `CustomEvent` detail value is `null`.
2022-02-21 09:42:42 -08:00

22 lines
355 B
Svelte

<script lang="ts">
import { ImageLoader } from "../types";
let loading = false;
let loaded = false;
let error = false;
</script>
<ImageLoader
bind:loading
bind:loaded
bind:error
fadeIn
ratio="16x9"
src=""
on:load="{(e) => {
console.log(e.detail); // null
}}"
on:error="{(e) => {
console.log(e.detail); // null
}}"
/>