@@ -3,7 +3,7 @@ import type { mastodon } from 'masto'
33import type { Ref } from 'vue'
44
55export function usePaginator < T , P , U = T > (
6- _paginator : mastodon . Paginator < T [ ] , P > ,
6+ paginator : mastodon . Paginator < T [ ] , P > ,
77 stream : Ref < mastodon . streaming . Subscription | undefined > ,
88 eventType : 'update' | 'notification' = 'update' ,
99 preprocess : ( items : ( T | U ) [ ] ) => U [ ] = items => items as unknown as U [ ] ,
@@ -12,7 +12,6 @@ export function usePaginator<T, P, U = T>(
1212 // called `next` method will mutate the internal state of the variable,
1313 // and we need its initial state after HMR
1414 // so clone it
15- const paginator = _paginator . clone ( )
1615
1716 const state = ref < PaginatorState > ( isHydrated . value ? 'idle' : 'loading' )
1817 const items = ref < U [ ] > ( [ ] )
@@ -75,7 +74,7 @@ export function usePaginator<T, P, U = T>(
7574
7675 state . value = 'loading'
7776 try {
78- const result = await paginator . next ( )
77+ const result = await paginator . values ( ) . next ( )
7978
8079 if ( ! result . done && result . value . length ) {
8180 const preprocessedItems = preprocess ( [ ...nextItems . value , ...result . value ] as ( U | T ) [ ] )
0 commit comments