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

@ -49,7 +49,7 @@ const getOrCreateTabId = () => {
return storedTabId; return storedTabId;
}; };
export interface IBroadcastChannelContext { interface IBroadcastChannelContext {
subscribe: ( subscribe: (
event: `${EBCEvent}`, event: `${EBCEvent}`,
callback: (message: BroadcastChannelData) => void, callback: (message: BroadcastChannelData) => void,

View File

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

View File

@ -8,13 +8,11 @@
import { useEffect } from "react"; import { useEffect } from "react";
import { import { useBroadcastChannel } from "../providers/BroadcastChannelProvider";
IBroadcastChannelContext,
useBroadcastChannel,
} from "../providers/BroadcastChannelProvider";
export const useSubscribeBroadcastChannel: IBroadcastChannelContext["subscribe"] = export const useSubscribeBroadcastChannel: ReturnType<
(...props) => { typeof useBroadcastChannel
>["subscribe"] = (...props) => {
const { subscribe } = useBroadcastChannel(); const { subscribe } = useBroadcastChannel();
useEffect(() => { useEffect(() => {

View File

@ -49,7 +49,7 @@ const getOrCreateTabId = () => {
return storedTabId; return storedTabId;
}; };
export interface IBroadcastChannelContext { interface IBroadcastChannelContext {
subscribe: ( subscribe: (
event: `${EBCEvent}`, event: `${EBCEvent}`,
callback: (message: BroadcastChannelData) => void, callback: (message: BroadcastChannelData) => void,