Show a limited number of items at once and keep the rest waiting in a queue.
This is custom React hooks, you need to follow the Basic Rules when you use it.
Only two items are visible, the others wait in the queue.
const useQueue = <T>(options?: {
initialValues?: T[]
limit?: number
}) => {
state: T[]
queue: T[]
add: (...items: T[]) => void
update: (fn: (items: T[]) => T[]) => void
cleanQueue: () => void
}