Skip to content

Commit

Permalink
to make reactive, export signal
Browse files Browse the repository at this point in the history
  • Loading branch information
KishiTheMechanic committed Oct 30, 2024
1 parent 64c8832 commit f125279
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 3 additions & 3 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useSignal } from '@preact/signals'
import { type Signal, useSignal } from '@preact/signals'
import { useEffect } from 'preact/hooks'

/**
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -125,5 +125,5 @@ export function useTheme(): UseThemeReturn {
theme.value = newTheme
}

return { theme: theme.value, setTheme }
return { theme, setTheme }
}

0 comments on commit f125279

Please sign in to comment.