Callback with arguments


I wonder why the Callback doesn’t accept arguments like:

        <Callback Handler="{click}">

It is cheap to use callbacks with arguments, otherwise I export many functions with different arguments.

Or, is there another better solution? I know the callback function binding with a data context object, but this doesn’t help much.



Thanks for reporting, you raise a good point. There is not a better solution than exposing the appropriate functions and obeservables. What usecase are you trying to solve here?

If we can find a proper usecase for this kind of logic we can add a feature request :slight_smile:

Just to hi-jack this thread. The reason I want something like this is to not have a lot of wrapper functions.

I don’t like this so much:

<Button><Callback Handler"{setTitleToText1}" /></Button>
<Button><Callback Handler"{setTitleToText2}" /></Button>
<Button><Callback Handler"{setTitleToText3}" /></Button>
<Button><Callback Handler"{setTitleToText4}" /></Button>
<Button><Callback Handler"{setTitleToText5}" /></Button>
<Button><Callback Handler"{setTitleToText6}" /></Button>
<Button><Callback Handler"{setTitleToText7}" /></Button>

I also would like to do something like this to centralize handlers or to use callbacks in enums.

Any updates? Can we now pass arguments?

A Button's (or Panel's more generally) Clicked function will receive an object whose data field contains the data context for the Button, if that’s what you guys are after:


function handler(arg) {
    // represents the item that was the data context for the button below


<Each Items="{items}">
    <Button Clicked="{handler}" />


I understand this example and use it in my app. But I am facing a problem I don’t understand. contains my object, but when I try to use it it’s undefined: like this :

function addtobucket(arg) {

			name: "", // a test 
			id:, // undefined
			price:, // undefined
console.log("panier contient en JSON -->  " + JSON.stringify(; // when I try this I can see all the data is here

Hi Gabson, can you provide a complete, minimal, runnable example for me, so I can more easily run this myself and help you out? Thanks!

Hello Jake,

Thansk for your answer, I am discussing this issue with Uldis on slack.
Great team by the way!

Cool, happy to hear it :smiley:

bumping this thread, was there an update on this? I have run into a similar issue and am interested to know.

@Kwame: there are no updates on whatever was discussed here in particular. You should make a new forum post, explaining exactly what it is that you want to do, and we’ll likely figure out a way for you to do it.

UserEvent will help you. (It accepts arguments)


Thanks to Fuse Devs for introducing this.