Skip to content

Commit

Permalink
lib: deps are optional for useInit
Browse files Browse the repository at this point in the history
  • Loading branch information
jelly authored and martinpitt committed May 9, 2024
1 parent 46fe9f5 commit ec7fd0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/lib/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,6 @@ export function useEvent<EM extends cockpit.EventMap, E extends keyof EM>(obj: c
* "useInit" and default to "[]".
*/

export function useInit<T, D extends Tuple>(func: () => T, deps: D, comps?: Comparators<D>, destroy: ((value: T) => void) | null = null): T {
export function useInit<T, D extends Tuple>(func: () => T, deps?: D, comps?: Comparators<D>, destroy: ((value: T) => void) | null = null): T {
return useObject(func, destroy, deps || [], comps);
}

0 comments on commit ec7fd0d

Please sign in to comment.