Repeater slow load time and bugs

You only need this handler whenever you’re calling your dataset to action, such as when you are calling your function:

$w(’ #dataset1 ‘).setFilter(newFilter).then((num) => {
console.log($w(’ #dataset1 ‘).getTotalCount(), “heres count”);
$w(’ #SearchCount ‘).text = $w(’ #dataset1 ').getTotalCount().toString();
});;
lastFilterTitle = title;
lastFilterVoiceType = voiceType;
lastFilterGenre = genre;
lastFilterMood = mood;
lastFilterAge = age;
} }

Basically, try adding this
$w(“#dataset1”).onReady( () => { ); } );
whenever you reference your dataset unless you are defining a function. i.e.:

$w(‘#dataset1’).onReady(() => {
$w(‘#dataset1’).setFilter(newFilter).then((num) => {
console.log($w(‘#dataset1’).getTotalCount(), “heres count”);
$w(‘#SearchCount’).text = $w(‘#dataset1’).getTotalCount().toString();
});
lastFilterTitle = title;
lastFilterVoiceType = voiceType;
lastFilterGenre = genre;
lastFilterMood = mood;
lastFilterAge = age;
}
);

This shouldn’t improve your load time, rather it will only allow an action to be called when the dataset is loaded and ready to function properly so that weird glitches and errors won’t occur. I have had to replace repeaters with other elements such as galleries on my mobile version in order to improve load times so if your aim is to do so, consider making one element for your desktop site and a different for your mobile even if you have to sacrifice a bit of functionality.

Good Luck!