<script>
	export let z = '???';
	export let answer = '42';

	function tap(node, callback) {
		const clickHandler = event => {
			callback({ answer });
		};

		node.addEventListener('click', clickHandler, false);

		return {
			destroy() {
				node.addEventListener('click', clickHandler, false);
			}
		};
	}
</script>

<button use:tap='{event => z = event.answer}'>{z}</button>
