Skip to main content
Ben Nadel at NCDevCon 2011 (Raleigh, NC) with: Jaana Gilbert and Brenda Priest and Jim Priest
Ben Nadel at NCDevCon 2011 (Raleigh, NC) with: Jaana Gilbert@jaanagilbert ) , Brenda Priest@BrendaYourDoor ) , and Jim Priest@thecrumb )

Nick

Member since Mar 10, 2022

Recent Blog Comments By Nick

  • Using AbortController To Debounce setTimeout() Calls In JavaScript

    Posted on Mar 10, 2022 at 10:31 AM

    Looks like true or {once: true} as the 3rd arg to signal.addEventListener removes the listener after it's called ๐Ÿ˜‰ function setAbortableTimeout(fn, ms, signal) { const timeout = setTimeout(fn, ms); signal.addEventListener("abort", () => clearTimeout(timeout), {}); };... read more »