mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix: remove IBroadcastChannelContext export
This commit is contained in:
parent
763ed82512
commit
8ea4251bcf
@ -49,7 +49,7 @@ const getOrCreateTabId = () => {
|
||||
return storedTabId;
|
||||
};
|
||||
|
||||
export interface IBroadcastChannelContext {
|
||||
interface IBroadcastChannelContext {
|
||||
subscribe: (
|
||||
event: `${EBCEvent}`,
|
||||
callback: (message: BroadcastChannelData) => void,
|
||||
|
@ -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]);
|
||||
};
|
||||
|
@ -8,17 +8,15 @@
|
||||
|
||||
import { useEffect } from "react";
|
||||
|
||||
import {
|
||||
IBroadcastChannelContext,
|
||||
useBroadcastChannel,
|
||||
} from "../providers/BroadcastChannelProvider";
|
||||
import { useBroadcastChannel } from "../providers/BroadcastChannelProvider";
|
||||
|
||||
export const useSubscribeBroadcastChannel: IBroadcastChannelContext["subscribe"] =
|
||||
(...props) => {
|
||||
const { subscribe } = useBroadcastChannel();
|
||||
export const useSubscribeBroadcastChannel: ReturnType<
|
||||
typeof useBroadcastChannel
|
||||
>["subscribe"] = (...props) => {
|
||||
const { subscribe } = useBroadcastChannel();
|
||||
|
||||
useEffect(() => {
|
||||
subscribe(...props);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [subscribe, ...props]);
|
||||
};
|
||||
useEffect(() => {
|
||||
subscribe(...props);
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [subscribe, ...props]);
|
||||
};
|
||||
|
@ -49,7 +49,7 @@ const getOrCreateTabId = () => {
|
||||
return storedTabId;
|
||||
};
|
||||
|
||||
export interface IBroadcastChannelContext {
|
||||
interface IBroadcastChannelContext {
|
||||
subscribe: (
|
||||
event: `${EBCEvent}`,
|
||||
callback: (message: BroadcastChannelData) => void,
|
||||
|
Loading…
Reference in New Issue
Block a user