Sign in
Log inSign up

How is the state of the applications maintained efficiently using jQuery or similar libraries? See the description for more details!

Pavan Mehta's photo
Pavan Mehta
·Dec 23, 2016

I started my career as an Angular Developer and moved on to use React JS. I'm just curious as to how is the state of the application maintained efficiently using jQuery or similar libraries. I've had to code a certain dashboard component in jQuery in one of the legacy code bases, and it was hard to maintain the state, and it felt so wrong.

Here's the situation. I've to call an API which gets 2 date arrays, I've to populate two dropdowns using that date and after I've to make an AJAX call on the click of a button. Meanwhile I also have to check both the dates are selected in the onClick event listener.

I just want to know the best practices of state (object and scope) management in jQuery for a mildly complicated scenario.