Skip to content

Commit

Permalink
remove type coercion
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianGonz97 committed Apr 27, 2024
1 parent 7a292bc commit 913f4cd
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 913f4cd

Please sign in to comment.