Events

Events in Embla are usually handled by the .on() function, however in Svelte-Embla I dispatch and destroy these events to the element automatically with the sveltes action life-cycle hooks, meaning you can assign any of embla event function in a normal svelte like manor, however due to conflicting event names I have prefixed all of the Embla Events with e- so for like example the event select has now become e-select.

Here is an example:

<script>
	import embla from "svelte-embla"
	const onSettle = () => console.log("the user has stopped scroll on the carousel")
</script>

<div class="embla" use:embla on:e-settle={onSettle}>
	<div class="embla__container">
		<div class="embla__slide">Slide 1</div>
		<div class="embla__slide">Slide 2</div>
		<div class="embla__slide">Slide 3</div>
	</div>
</div>