feat: Add home timeline for logged-in users

This commit is contained in:
Jesse Wierzbinski 2024-04-28 16:59:28 -10:00
parent 63cbe6bb82
commit 8c68957df8
No known key found for this signature in database
4 changed files with 56 additions and 1 deletions

View file

@ -0,0 +1,23 @@
import type { Mastodon } from "megalodon";
import type { Status } from "~/types/mastodon/status";
export const useHomeTimeline = (
client: Mastodon | null,
options: MaybeRef<{
local?: boolean;
limit?: number;
max_id?: string;
since_id?: string;
min_id?: string;
}>,
): {
timeline: Ref<Status[]>;
loadNext: () => Promise<void>;
loadPrev: () => Promise<void>;
} => {
return useTimeline(
client,
(client, options) => client?.getHomeTimeline(options),
options,
);
};