<script>
	export let bar;

	function handleFoo(bar) {
		console.log(bar);
	}

	function foo(node, callback) {
		// code goes here
	}
</script>

<button use:foo='{() => handleFoo(bar)}'>foo</button>