mirror of
https://github.com/remvze/moodist.git
synced 2025-12-18 01:14:17 +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 { useEffect } from 'react';
|
||||||
|
|
||||||
import { onCloseModal } from '@/lib/modal';
|
import { onCloseModals } from '@/lib/modal';
|
||||||
|
|
||||||
export function useCloseListener(listener: () => void) {
|
export function useCloseListener(listener: () => void) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const unsubscribe = onCloseModal(listener);
|
const unsubscribe = onCloseModals(listener);
|
||||||
|
|
||||||
return unsubscribe;
|
return unsubscribe;
|
||||||
}, [listener]);
|
}, [listener]);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ export function closeModals() {
|
||||||
dispatch('closeModals');
|
dispatch('closeModals');
|
||||||
}
|
}
|
||||||
|
|
||||||
export function onCloseModal(listener: () => void) {
|
export function onCloseModals(listener: () => void) {
|
||||||
subscribe('closeModals', listener);
|
subscribe('closeModals', listener);
|
||||||
|
|
||||||
return () => unsubscribe('closeModals', listener);
|
return () => unsubscribe('closeModals', listener);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue