Skip to content

Commit

Permalink
fix: remove type coercion from useSupported (#28)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 authored Apr 27, 2024
1 parent 7a292bc commit 6fd2b9a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ import { type ReadableBox, box } from "../box/box.svelte.js";
* }
* ```
*/
export function useSupported(predicate: () => unknown): ReadableBox<boolean> {
export function useSupported(predicate: () => boolean): ReadableBox<boolean> {
const isSupported = box(false);

$effect(() => {
isSupported.value = Boolean(predicate());
isSupported.value = predicate();
});

return box.readonly(isSupported);
Expand Down

0 comments on commit 6fd2b9a

Please sign in to comment.