Skip to content

useQueue ​

Category
Utilities

Hook that manages a queue

typescript
import { useQueue } from '@siberiacancode/reactuse';

Usage ​

typescript
const { queue, add, remove, clear, first, last, size } = useQueue([1, 2, 3]);

Demo ​

Api ​

Parameters

NameTypeDefaultNote
initialValue?Value[][]The initial value of the queue

Contributors ​

Source • Demo