diff options
| author | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-05-10 14:42:18 +0900 |
|---|---|---|
| committer | syuilo <4439005+syuilo@users.noreply.github.com> | 2025-05-10 14:42:18 +0900 |
| commit | 039aacb31f7aabeec8c4174efec2c3f97984bea4 (patch) | |
| tree | 10c0aa56036557092cb1abe593d53ddda8df64c3 | |
| parent | Bump version to 2025.5.1-alpha.1 (diff) | |
| download | misskey-039aacb31f7aabeec8c4174efec2c3f97984bea4.tar.gz misskey-039aacb31f7aabeec8c4174efec2c3f97984bea4.tar.bz2 misskey-039aacb31f7aabeec8c4174efec2c3f97984bea4.zip | |
refactor(frontend): better type def of usePagination
| -rw-r--r-- | packages/frontend/src/composables/use-pagination.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/frontend/src/composables/use-pagination.ts b/packages/frontend/src/composables/use-pagination.ts index f1042985bf..8dd3b888db 100644 --- a/packages/frontend/src/composables/use-pagination.ts +++ b/packages/frontend/src/composables/use-pagination.ts @@ -37,8 +37,8 @@ export type PagingCtx<E extends keyof Misskey.Endpoints = keyof Misskey.Endpoint direction?: 'newer' | 'older'; }; -export function usePagination<T extends MisskeyEntity>(props: { - ctx: PagingCtx; +export function usePagination<Endpoint extends keyof Misskey.Endpoints, T = Misskey.Endpoints[Endpoint]['res'] extends (infer I)[] ? I : never>(props: { + ctx: PagingCtx<Endpoint>; useShallowRef?: boolean; }) { const items = props.useShallowRef ? shallowRef<T[]>([]) : ref<T[]>([]); |