mirror of
https://github.com/remvze/moodist.git
synced 2025-12-17 17:04:15 +00:00
refactor: better name
This commit is contained in:
parent
af92b1ed90
commit
2192335238
2 changed files with 3 additions and 3 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue