Skip to content

Commit

Permalink
add type Atom
Browse files Browse the repository at this point in the history
  • Loading branch information
KishiTheMechanic committed Oct 30, 2024
1 parent 78ebdbb commit e68c37b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 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.2.0",
"version": "1.2.1",
"description": "Theme Module for Fresh v2 App.",
"runtimes": ["deno", "browser"],
"exports": "./mod.ts",
Expand Down
4 changes: 2 additions & 2 deletions mod.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { useEffect } from 'preact/hooks'
import { atom, useAtom } from 'fresh-atom'
import { type Atom, atom, useAtom } from 'fresh-atom'

/**
* Atom for theme management, storing either 'dark' or 'light' mode.
* Initializes theme based on `localStorage` or defaults to 'dark'.
*
* @type {Atom<'dark' | 'light'>}
*/
export const themeAtom = atom<'dark' | 'light'>(
export const themeAtom: Atom<'dark' | 'light'> = atom(
(localStorage.getItem('theme') as 'dark' | 'light') || 'dark',
)

Expand Down

0 comments on commit e68c37b

Please sign in to comment.