From 97a1fb9cf14cc5c741112c89fc151b06c2072db1 Mon Sep 17 00:00:00 2001 From: thislight Date: Mon, 4 Nov 2024 18:03:53 +0800 Subject: [PATCH] createTimelineControlsForArray: catch error --- src/masto/timelines.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/masto/timelines.ts b/src/masto/timelines.ts index 1aaefb1..6e5eb9b 100644 --- a/src/masto/timelines.ts +++ b/src/masto/timelines.ts @@ -26,7 +26,9 @@ export function createTimelineControlsForArray( const [threads, setThreads] = createStore([] as mastodon.v1.Status["id"][]); createEffect(() => { - const nls = status(); + const nls = catchError(status, (e) => { + console.error(e); + }); if (!nls) return; setThreads([]); @@ -226,9 +228,7 @@ export type TimelineControls = { set(id: string, value: mastodon.v1.Status): void; }; -export type TimelineResource< - R, -> = [ +export type TimelineResource = [ TimelineControls, Resource, { refetch(info?: TimelineFetchDirection): void }, @@ -238,7 +238,7 @@ export type TimelineResource< * Create auto managed timeline controls. * * The error from the resource is not thrown in the - * {@link TimelineControls.list} and {@link TimelineControls}.get*. + * {@link TimelineControls["list"]} and {@link TimelineControls}.get*. * Use the second value from {@link TimelineResource} to catch the error. */ export function createTimeline<