This repository was archived by the owner on Jul 6, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
- import { DependencyList , useContext , useEffect , useState } from 'https://esm.sh/react'
1
+ import { useContext , useEffect , useState } from 'https://esm.sh/react'
2
2
import { RouterContext } from './context.ts'
3
3
import { AsyncUseDenoError } from './error.ts'
4
4
import events from './events.ts'
5
+ import type { RouterURL } from './types.ts'
5
6
6
- export function useRouter ( ) {
7
+ export function useRouter ( ) : RouterURL {
7
8
return useContext ( RouterContext )
8
9
}
9
10
10
- export function useDeno < T = any > ( callback : ( ) => ( T | Promise < T > ) , browser ?: boolean , deps ?: DependencyList ) {
11
+ export function useDeno < T = any > ( callback : ( ) => ( T | Promise < T > ) , browser ?: boolean , deps ?: ReadonlyArray < any > ) : T {
11
12
const id = arguments [ 3 ] // generated by compiler
12
13
const { pathname, query } = useRouter ( )
13
- const [ data , setDate ] = useState < T > ( ( ) => {
14
+ const [ data , setDate ] = useState ( ( ) => {
14
15
const global = window as any
15
16
const { _useDenoAsyncData : asyncData } = global
16
17
const useDenoUrl = `useDeno://${ pathname } ?${ query . toString ( ) } `
You can’t perform that action at this time.
0 commit comments