Commit c912f3d6 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Convert StreamView to TS

parent 69f1ca28
...@@ -2,23 +2,23 @@ import { useCallback, useEffect } from 'preact/hooks'; ...@@ -2,23 +2,23 @@ import { useCallback, useEffect } from 'preact/hooks';
import * as searchFilter from '../util/search-filter'; import * as searchFilter from '../util/search-filter';
import { withServices } from '../service-context'; import { withServices } from '../service-context';
import type { APIService } from '../services/api';
import type { ToastMessengerService } from '../services/toast-messenger';
import { useRootThread } from './hooks/use-root-thread'; import { useRootThread } from './hooks/use-root-thread';
import { useSidebarStore } from '../store'; import { useSidebarStore } from '../store';
import ThreadList from './ThreadList'; import ThreadList from './ThreadList';
/** export type StreamViewProps = {
* @typedef StreamViewProps // injected
* @prop {import('../services/api').APIService} api api: APIService;
* @prop {import('../services/toast-messenger').ToastMessengerService} toastMessenger toastMessenger: ToastMessengerService;
*/ };
/** /**
* The main content of the "stream" route (https://hypothes.is/stream) * The main content of the "stream" route (https://hypothes.is/stream)
*
* @param {StreamViewProps} props
*/ */
function StreamView({ api, toastMessenger }) { function StreamView({ api, toastMessenger }: StreamViewProps) {
const store = useSidebarStore(); const store = useSidebarStore();
const currentQuery = store.routeParams().q; const currentQuery = store.routeParams().q;
...@@ -26,8 +26,7 @@ function StreamView({ api, toastMessenger }) { ...@@ -26,8 +26,7 @@ function StreamView({ api, toastMessenger }) {
* Fetch annotations from the API and display them in the stream. * Fetch annotations from the API and display them in the stream.
*/ */
const loadAnnotations = useCallback( const loadAnnotations = useCallback(
/** @param {string} query */ async (query: string) => {
async query => {
const queryParams = { const queryParams = {
_separate_replies: true, _separate_replies: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment