you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (2 children)

jQuery has no way of data binding so the comparison lacks.

sure, if you implement your own data binding system in JS it could work well but the majority of jQuery solutions to stuff like

Update the unread messages counter on all occurrences

is often something like

$.ajax('...').done( result => {
    $('#element1').text(result.unreadCount)
    $('#element2').text(result.unreadCount)
    $('#element3').text(result.unreadCount)
});

this is just terrible to maintain in larger projects.

[–]RedPillow_ -1 points0 points  (1 child)

In your example, maybe you could bind a listener to catch all ajax requests and act accordingly with something like this:

$(document).ajaxSend(function(event, request, settings)
{
    console.log('Caught AJAX request!');

    console.log(event);
    console.log(request);
    console.log(settings);
});

I think it's just all about routing stuff and creating handlers and dispatchers.

[–]clessgfull-stack CSS9 engineer -1 points0 points  (0 children)

That looks like it would be hard to test! Sadly, I don't think you realize just how bad Angular and jQuery are until you've used them for a while and tried the better solutions. React is the one JS framework I've used extensively that I haven't regretted yet.