pleroma/app/soapbox/api/hooks/streaming/useRemoteStream.ts

15 lines
394 B
TypeScript
Raw Normal View History

2023-07-22 11:16:01 -07:00
import { useTimelineStream } from './useTimelineStream';
interface UseRemoteStreamOpts {
instance: string
onlyMedia?: boolean
}
function useRemoteStream({ instance, onlyMedia }: UseRemoteStreamOpts) {
return useTimelineStream(
`remote${onlyMedia ? ':media' : ''}:${instance}`,
`public:remote${onlyMedia ? ':media' : ''}&instance=${instance}`,
);
}
export { useRemoteStream };