nicolium: types

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2026-02-27 01:47:11 +01:00
parent 45030f942e
commit 9c2d7b3788
4 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
import { useTimelineStream } from './use-timeline-stream';
const useGroupStream = (groupId: string) => useTimelineStream('group', { group: groupId } as any);
const useGroupStream = (groupId: string) => useTimelineStream('group', { group: groupId });
export { useGroupStream };

View File

@@ -9,7 +9,7 @@ import type { StreamingEvent } from 'pl-api';
const useTimelineStream = (
stream: string,
params: { list?: string; tag?: string } = {},
params: { list?: string; tag?: string; group?: string } = {},
enabled = true,
listener?: (event: StreamingEvent) => any,
) => {
@@ -26,6 +26,7 @@ const useTimelineStream = (
params?: {
list?: string;
tag?: string;
group?: string;
},
) => void;
unsubscribe: (
@@ -33,6 +34,7 @@ const useTimelineStream = (
params?: {
list?: string;
tag?: string;
group?: string;
},
) => void;
close: () => void;
@@ -61,7 +63,7 @@ const useTimelineStream = (
socket.current?.subscribe(stream, params);
return () => socket.current?.unsubscribe(stream, params);
}, [stream, params.list, params.tag, enabled]);
}, [stream, params.list, params.tag, params.group, enabled]);
useEffect(() => {
if (enabled) {