Being used to javascript, I am in the habit of writing an event handler within the page.onReady function, for example:
$w.onReady(function () {
$w("#productrepeater").onItemReady(($item, itemData, index) => {
// set up the repeater $item with data
FillRepeater($item, itemData);
});
// ...
});
This seems to work okay in Corvid code. However, I see that most examples create an extern function handler that the wix platform wires up:
$w.onReady(function () {
// ...
});
export function productrepeater_itemReady($item, itemData, index) {
//Add your code for this event here:
}
I am wondering if how I am doing it is going to stop working, or is wrong and I’ve just been lucky, Anyone?