function listen_to_event_and_reset_event(element, event, handler, on_reset = handler) {
	element.addEventListener(event, () => without_reactive_context(handler));
	// @ts-expect-error
	const prev = element.__on_r;
	if (prev) {
		// special case for checkbox that can have multiple binds (group & checked)
		// @ts-expect-error
		element.__on_r = () => {
			prev();
			on_reset(true);
		};
	} else {
		// @ts-expect-error
		element.__on_r = () => on_reset(true);
	}

	add_form_reset_listener();
}
Listen to the given event, and then instantiate a global form reset listener if not already done,
to notify all bindings when the form is reset
@param {HTMLElement} element
@param {string} event
@param {(is_reset?: true) => void} handler
@param {(is_reset?: true) => void} [on_reset]