I'm creating a chatting app. How do I achieve real time sync. What I have done currently is to invoke list service every 3 seconds on page show event like this:
function reList() {
list.execute({});
setTimeout(runCode,3000);
$('.ui-loading div.ui-loader').css('display', 'none');
}
reList();
this seems to slow down the app a lot.
Is there a better way to do this?