mirror of
https://github.com/remvze/moodist.git
synced 2025-09-29 15:30:49 -04:00
refactor: better name
This commit is contained in:
parent
af92b1ed90
commit
2192335238
@ -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…
x
Reference in New Issue
Block a user