createTimelineControlsForArray: catch error
This commit is contained in:
parent
c22860a7e3
commit
97a1fb9cf1
1 changed files with 5 additions and 5 deletions
|
@ -26,7 +26,9 @@ export function createTimelineControlsForArray(
|
||||||
const [threads, setThreads] = createStore([] as mastodon.v1.Status["id"][]);
|
const [threads, setThreads] = createStore([] as mastodon.v1.Status["id"][]);
|
||||||
|
|
||||||
createEffect(() => {
|
createEffect(() => {
|
||||||
const nls = status();
|
const nls = catchError(status, (e) => {
|
||||||
|
console.error(e);
|
||||||
|
});
|
||||||
if (!nls) return;
|
if (!nls) return;
|
||||||
|
|
||||||
setThreads([]);
|
setThreads([]);
|
||||||
|
@ -226,9 +228,7 @@ export type TimelineControls = {
|
||||||
set(id: string, value: mastodon.v1.Status): void;
|
set(id: string, value: mastodon.v1.Status): void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TimelineResource<
|
export type TimelineResource<R> = [
|
||||||
R,
|
|
||||||
> = [
|
|
||||||
TimelineControls,
|
TimelineControls,
|
||||||
Resource<R>,
|
Resource<R>,
|
||||||
{ refetch(info?: TimelineFetchDirection): void },
|
{ refetch(info?: TimelineFetchDirection): void },
|
||||||
|
@ -238,7 +238,7 @@ export type TimelineResource<
|
||||||
* Create auto managed timeline controls.
|
* Create auto managed timeline controls.
|
||||||
*
|
*
|
||||||
* The error from the resource is not thrown in the
|
* 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.
|
* Use the second value from {@link TimelineResource} to catch the error.
|
||||||
*/
|
*/
|
||||||
export function createTimeline<
|
export function createTimeline<
|
||||||
|
|
Loading…
Reference in a new issue