<script>
	function foo() {}
	function bar() {}
</script>

<div in:foo transition:bar>...</div>