espruino / Espruino

The Espruino JavaScript interpreter - Official Repo
http://www.espruino.com/
Other
2.75k stars 739 forks source link

Split `setUI` types into overloaded functions #2348

Closed bobrippling closed 1 year ago

bobrippling commented 1 year ago

This prevents erroneous usage, e.g. a callback with "clock" or expecting undefined to be passed to a "clockupdown" callback.

It also "blesses" {mode: "clock" | "updown" | ...} with a subset of options which are handled by setUI (remove and back).

Also make removeAllListeners()'s first argument optional.

gfwilliams commented 1 year ago

Great - thanks!