Skip to content

Commit 8c35558

Browse files
committed
feat: Add public hook for registering events
1 parent d65414e commit 8c35558

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/hooks/useOnRcbEvent.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import { useBotId } from './useBotId';
1010
* @param handler callback that receives the event with `detail` containing botId and path info
1111
*/
1212
export const useOnRcbEvent = (eventName: RcbEvent, handler: (event: RcbBaseEvent) => void) => {
13-
const { getBotId } = useBotId();
13+
const { getBotId } = useBotId();
1414

1515
useEffect(() => {
1616
const listener = (event: RcbBaseEvent) => {
17-
// ensures chatbots only respond to their own events
18-
if (event.detail.botId !== getBotId()) {
19-
return;
20-
}
17+
// ensures chatbots only respond to their own events
18+
if (event.detail.botId !== getBotId()) {
19+
return;
20+
}
2121
handler(event);
2222
};
2323

0 commit comments

Comments
 (0)