In JSX it's possible to bind multiple events to a DOM element like this:
<input {...inputEvents}>
In Svelte, this is done manually.
<input on:input={inputHandler}>
This becomes tedious when you need to add multiple handlers (input, blur, focus) to multiple inputs of a form.
The only way I've found to solve this in Svelte is by using refs.
For example:
<input bind:this={myInput}>
And then somewhere either do this:
myInput.oninput = (event) => { // do something}
Or:
myInput.addEventListener('click', (event) => { // do something})
Is there a better way to bind events dynamically in Svelte?