Skip to content

Instantly share code, notes, and snippets.

@lotharschulz
Last active October 27, 2021 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lotharschulz/df6f08e6d602092dcacb263994d2244f to your computer and use it in GitHub Desktop.
Save lotharschulz/df6f08e6d602092dcacb263994d2244f to your computer and use it in GitHub Desktop.
// please see also the accompanying blog post
// https://www.lotharschulz.info/2021/10/14/how-to-create-a-react-frontend-to-debounce-text-input-persistence-in-firebase-firestore/
const saveFieldValueDebounced = AwesomeDebouncePromise(
saveFieldValue,
debounceDelay,
{ key: fieldId => fieldId },
);
const saveFieldValue = (fieldId: number, fieldValue: string) => saveToDB(fieldValue);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment