Skip to content

Commit

Permalink
breaking: deprecate MediaQuery and Store (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte authored Dec 19, 2024
1 parent cc911f2 commit 16345d6
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 271 deletions.
5 changes: 5 additions & 0 deletions .changeset/dirty-bats-heal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"runed": minor
---

breaking: deprecate `MediaQuery` in favor of Svelte's `MediaQuery`
5 changes: 5 additions & 0 deletions .changeset/dull-pens-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"runed": patch
---

simplify `IsSupported` internals
5 changes: 5 additions & 0 deletions .changeset/twelve-weeks-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"runed": minor
---

breaking: deprecate `Store` in favor of Svelte's `fromStore` and `toStore`
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { browser } from "$lib/internal/utils/browser.js";

/**
* A class that takes a predicate to determine if a browser API is supported.
*
Expand All @@ -6,12 +8,10 @@
* @see {@link https://runed.dev/docs/utilities/supported}
*/
export class IsSupported {
#current: boolean = $state(false);
#current: boolean = false;

constructor(predicate: () => unknown) {
$effect(() => {
this.#current = Boolean(predicate());
});
if (browser) this.#current = Boolean(predicate());
}

get current(): boolean {
Expand Down
72 changes: 0 additions & 72 deletions packages/runed/src/lib/utilities/MediaQuery/MediaQuery.svelte.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/runed/src/lib/utilities/MediaQuery/index.ts

This file was deleted.

38 changes: 0 additions & 38 deletions packages/runed/src/lib/utilities/Store/Store.svelte.ts

This file was deleted.

28 changes: 0 additions & 28 deletions packages/runed/src/lib/utilities/Store/Store.test.svelte.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/runed/src/lib/utilities/Store/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions packages/runed/src/lib/utilities/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ export * from "./Previous/index.js";
export * from "./watch/index.js";
export * from "./Readable/index.js";
export * from "./Debounced/index.js";
export * from "./Store/index.js";
export * from "./PressedKeys/index.js";
export * from "./MediaQuery/index.js";
export * from "./ElementRect/index.js";
export * from "./useMutationObserver/index.js";
export * from "./useResizeObserver/index.js";
Expand Down
51 changes: 0 additions & 51 deletions sites/docs/src/content/utilities/media-query.md

This file was deleted.

32 changes: 0 additions & 32 deletions sites/docs/src/content/utilities/store.md

This file was deleted.

24 changes: 0 additions & 24 deletions sites/docs/src/lib/components/demos/media-query.svelte

This file was deleted.

18 changes: 0 additions & 18 deletions sites/docs/src/lib/components/demos/store.svelte

This file was deleted.

0 comments on commit 16345d6

Please sign in to comment.