Rerun onReady function

Hi Pierre,

in your on ready function do not write the full code, just call another function that will do that.
then call the same function to rerun the same code based on another event

for example instead of:

$w.onReady(function () {
    $w('#switch').onClick(event => {
 if ($w('#switch').label === 'On') {
            $w('#switch').label = 'Off';
        } else {
            $w('#switch').label = 'On';
        }
    });
});

do the following:

$w.onReady(function () {
    flipTheSwitch();
});

export function container2_onClick(event) {
    flipTheSwitch();
}
export function flipTheSwitch() {
    $w('#switch').onClick(event => {
    if ($w('#switch').label === 'On') {
            $w('#switch').label = 'Off';
        } else {
            $w('#switch').label = 'On';
        }
    });
}

Shlomi