
I'm trying to write a single sheetworker to work for a large number of buttons, matching each button to a corresponding attr. const lights = [ 'lights5a', 'lights5b' ]; lights.forEach(button => { on(`clicked:${button}`, () => { getAttrs([`${button}`], v=> { setAttrs({ [`${button}`]: ((+v.[`${button}`] || 0) + 1) % 2 }); }); }); }); This is currently set up for two buttons, lights5a and lights5b. There is a corresponding attr for each with the same names. When a button is clicked the worker should set the corresponding attr to 1 if it's currently 0 and 0 if it's currently 1. I've copied work I've done (with help!) on previous sheets but haven't used ${button} in getAttrs or after the colon in setAttrs before, so I suspect the error lies in one of those. Can anyone please advise?