<script>
import {clickOutside} from './clickOutside.js';
let name = 'world';
function handleClickOutside(event) {
alert('Click outside!');
}
</script>
<h1>Hello {name}!</h1>
<div use:clickOutside on:click_outside={handleClickOutside}>
Click outside me!
</div>
<style>
div {
height: 100px;
color: white;
background-color: steelblue;
border-radius: 4px;
display: flex;
align-items:center;
justify-content: center;
}
</style>