breaking(breakpoint): add breakpointObserver store (#1092)

* breaking: re-name event "on:match" to "on:change" in `Breakpoint.svelte`

* feat: add `breakpointObserver` read-only store

* refactor: export breakpoint constants from `breakpoints.js`
This commit is contained in:
brunnerh 2022-03-08 17:38:58 +01:00 committed by GitHub
commit 5de0d9a357
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 180 additions and 101 deletions

View file

@ -1,14 +1,14 @@
<script lang="ts">
import { Breakpoint } from "../types";
import type { BreakpointSize } from "../types/Breakpoint/Breakpoint.svelte";
import type { BreakpointProps } from "../types/Breakpoint/Breakpoint.svelte";
let size: BreakpointSize;
let size: BreakpointProps["size"];
</script>
<Breakpoint
bind:size
let:size="{currentSize}"
on:match="{(e) => {
on:change="{(e) => {
console.log(e.detail);
}}"
>