Binding a function to a button is easy and straightforward:
<button on:click={handleClick}>
Clicks are handled by the handleClick function!
</button>
But I don't see a way to pass parameters (arguments) to the function, when I do this:
<button on:click={handleClick("parameter1")}>
Oh no!
</button>
The function is called on page load, and never again.
Is it possible at all to pass parameters to function called from on:click{}
?
**EDIT:**
I just found a hacky way to do it. Calling the function from an inline handler works.
<button on:click={() => handleClick("parameter1")}>
It works...
</button>