brunorplima / divino-dog-menu-app

Automated menu and order app for Divino Dog
divino-dog-menu-app.vercel.app
0 stars 0 forks source link

Add debounce feature for saving settingsModel.aboutUsContent #119

Closed brunorplima closed 2 years ago

brunorplima commented 2 years ago

Currently the admin page settings section specifically the aboutUsContent textarea is running a function that saves to the database on each change event. This caused the firestore database to go over the free tier limit a couple of times already. To prevent data from being saved multiple times (too many server requests) apply a debounce effect allowing changes to be saved only after 1 second of the last change event, canceling any save calls whenever a change event occurs in less than a second after the other.