diff --git a/deno.json b/deno.json index b66ab39..d587121 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@elsoul/fresh-theme", - "version": "1.1.0", + "version": "1.1.1", "description": "Theme Module for Fresh v2 App.", "runtimes": ["deno", "browser"], "exports": "./mod.ts", diff --git a/mod.ts b/mod.ts index f4a2530..2141b2f 100644 --- a/mod.ts +++ b/mod.ts @@ -1,4 +1,4 @@ -import { useSignal } from '@preact/signals' +import { type Signal, useSignal } from '@preact/signals' import { useEffect } from 'preact/hooks' /** @@ -75,7 +75,7 @@ export function setTheme(newTheme: 'dark' | 'light'): void { * Type definition for the return value of the useTheme hook. */ type UseThemeReturn = { - theme: 'dark' | 'light' + theme: Signal<'dark' | 'light'> setTheme: (newTheme: 'dark' | 'light') => void } @@ -125,5 +125,5 @@ export function useTheme(): UseThemeReturn { theme.value = newTheme } - return { theme: theme.value, setTheme } + return { theme, setTheme } }