refactor: better name

This commit is contained in:
MAZE 2024-04-24 19:50:44 +03:30
parent af92b1ed90
commit 2192335238
2 changed files with 3 additions and 3 deletions

View File

@ -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]);

View File

@ -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);