Skip to content

Commit

Permalink
fix(useMemo): un-needed use of use memo
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcMcIntosh committed Mar 7, 2024
1 parent 7942a75 commit 1e845e3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/hooks/useEventBusForChat.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { useEffect, useReducer, useCallback, useMemo } from "react";
import { useEffect, useReducer, useCallback } from "react";
import {
ChatContextFile,
// ChatContextFileMessage,
ChatMessages,
ChatResponse,
isChatContextFileMessage,
Expand Down Expand Up @@ -411,7 +410,9 @@ const initialState = createInitialState();
// Maybe use context to avoid prop drilling?
export const useEventBusForChat = () => {
const [state, dispatch] = useReducer(reducer, initialState);
const postMessage = useMemo(usePostMessage, []);
const postMessage = usePostMessage();

console.log({ state });

Check warning on line 415 in src/hooks/useEventBusForChat.ts

View workflow job for this annotation

GitHub Actions / build (lts/*)

Unexpected console statement

Check warning on line 415 in src/hooks/useEventBusForChat.ts

View workflow job for this annotation

GitHub Actions / build (latest)

Unexpected console statement

useEffect(() => {
const listener = (event: MessageEvent) => {
Expand Down

0 comments on commit 1e845e3

Please sign in to comment.