useQueue

React state hook implements simple FIFO queue.

hooks
  • first:
  • last:
  • size: 0

Variants

with useHooks

UseQueue

Front

  • First: 1
  • Item: 2
  • Last: 3

Back

3 items in the queue

The useQueue hook is a useful tool for managing a queue of elements within a functional component. It allows you to easily add, remove, and clear elements from the queue while maintaining the necessary state updates. The hook returns an object that includes the functions for manipulating the queue (add, remove, and clear), as well as additional properties such as first, last, size, and queue.

Installation

Run the following command:

npx ever-ui-clx@0.2.1 add demo-use-queue
# └──> Hook coming soon.

Usage