Skip to content

🚀 Improve inference of from the signature of the the function where debounce is used

Latest
Compare
Choose a tag to compare
@chodorowicz chodorowicz released this 14 Nov 11:29
7e7bc24

Breaking

  • improve type inference thanks @juanmendes for the idea
    • since we're improving types in some scenarios (instead of any you can get more precise types) this can break your type checks
const inputs = document.querySelectorAll("input");
inputs[0].addEventListener(
  "input",
  debounce((event) => {
    // here Event has `Event` type, before it was just `any`
    expectType<EventTarget | null>(event.target);
  }, 0)
);

other

  • 🧪 introduce tsd type testing
  • 📝 add past contributors
  • 💅 Add Prettier, format files

v3.0.0...v4.0.0