mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
feat: ✨ Add home timeline for logged-in users
This commit is contained in:
parent
63cbe6bb82
commit
8c68957df8
4 changed files with 56 additions and 1 deletions
23
composables/HomeTimeline.ts
Normal file
23
composables/HomeTimeline.ts
Normal 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,
|
||||
);
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue