fix: remove IBroadcastChannelContext export

This commit is contained in:
yassinedorbozgithub
2025-01-30 10:47:37 +01:00
parent 763ed82512
commit 8ea4251bcf
4 changed files with 21 additions and 25 deletions

View File

@@ -8,16 +8,14 @@
import { useEffect } from "react";
import {
IBroadcastChannelContext,
useBroadcastChannel,
} from "@/contexts/broadcast-channel.context";
import { useBroadcastChannel } from "@/contexts/broadcast-channel.context";
export const useSubscribeBroadcastChannel: IBroadcastChannelContext["subscribe"] =
(...props) => {
const { subscribe } = useBroadcastChannel();
export const useSubscribeBroadcastChannel: ReturnType<
typeof useBroadcastChannel
>["subscribe"] = (...props) => {
const { subscribe } = useBroadcastChannel();
useEffect(() => {
subscribe(...props);
}, [subscribe, ...props]);
};
useEffect(() => {
subscribe(...props);
}, [subscribe, ...props]);
};