fix: group follow notification
append current group before push a single item
This commit is contained in:
parent
efe7d639c1
commit
83db9f0c38
4 changed files with 37 additions and 52 deletions
|
@ -1,11 +1,11 @@
|
|||
import type { Paginator, WsEvents } from 'masto'
|
||||
import type { PaginatorState } from '~/types'
|
||||
|
||||
export function usePaginator<T, P>(
|
||||
export function usePaginator<T, P, U = T>(
|
||||
paginator: Paginator<T[], P>,
|
||||
stream?: Promise<WsEvents>,
|
||||
eventType: 'notification' | 'update' = 'update',
|
||||
preprocess: (items: T[]) => T[] = (items: T[]) => items,
|
||||
preprocess: (items: T[]) => U[] = (items: T[]) => items as unknown as U[],
|
||||
buffer = 10,
|
||||
) {
|
||||
const state = ref<PaginatorState>(isMastoInitialised.value ? 'idle' : 'loading')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue