Skip to content

Commit

Permalink
refactor: better name
Browse files Browse the repository at this point in the history
  • Loading branch information
remvze committed Apr 24, 2024
1 parent af92b1e commit 2192335
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/hooks/use-close-listener.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { useEffect } from 'react';

import { onCloseModal } from '@/lib/modal';
import { onCloseModals } from '@/lib/modal';

export function useCloseListener(listener: () => void) {
useEffect(() => {
const unsubscribe = onCloseModal(listener);
const unsubscribe = onCloseModals(listener);

return unsubscribe;
}, [listener]);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function closeModals() {
dispatch('closeModals');
}

export function onCloseModal(listener: () => void) {
export function onCloseModals(listener: () => void) {
subscribe('closeModals', listener);

return () => unsubscribe('closeModals', listener);
Expand Down

0 comments on commit 2192335

Please sign in to comment.