Hello!
I’ve created the following event handler block in my extension:
The question I have is, why are the two variables globally scoped (with the drop down and added to the list of project variables)? And how can I make them local to just this block? I seem to remember a few blocks like this which all seem to be local… Here is the code:
//% weight=60
//% block="Classification Changed"
//% draggableParameters = reporter
//% color=#00B1ED
//% blockGap=8
export function onClassificationChanged(handler: (predictionName: string, score: number) => void) {
onClassificationChangedHandler = handler;
}
Any help would be much appreciated, thank you!