Skip to content

Gui: on the frontend, the control callback does not get the context it set when it was registered #721

@giuliomoro

Description

@giuliomoro

e.g.:

let controlCallback = (data) => {
     console.log(this);
}
Bela.control.registerCallback("controlCallback", controlCallback, { val: 1, otherval: 2});

prints

Window [window: Window(0), self: Window(0), document: document, name: '', location: Location, …]

I don't see any obvious issue in BelaControl.js:

		Object.values(this.callbacks).forEach( c  => c.function.call(c.object, parsedData) );

seems to be doing what it's meant to, but call() doesn't seem to set c.object as this as it should.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions