Queuing up changes
Now we've bound the user controls to the data model and automatically save it every time a change is made. There's one problem with this though. Input controls like the number
or time
types that have spinners associated with them cause a change
event every time a spinner button is clicked. If the user holds a spinner button down it will fire change
events at an alarming rate. This will in turn save the task list to localStorage
repeatedly in a very short period of time. That doesn't seem like a very efficient thing to do, especially if you have a lot of data.
Get HTML5 Web Application Development By Example Beginner's guide now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.