windowScrollStore

Reactive window scroll

Demo

See scroll values in the lower right corner of the screen.
Scroll value:
X: 0
Y: 0

Usage

<script>
import { windowScrollStore } from 'svelte-legos';

const position = windowScrollStore()
</script>

<div>X: {$position.x}</div>
<div>Y: {$position.y}</div>