Skip to content

Commit 70746e0

Browse files
Added Missing Return Statement at the useQueue hook.
In this contribution, I enhanced the functionality of the existing queue library in the GitHub repository. The library, which was designed to manage a queue data structure, contained several useful methods such as add, remove, and clear, as well as properties to access the first and last elements in the queue, its size, and the queue itself. However, during my code review, I noticed that the library was missing a crucial return statement at the end of the function, preventing other developers from accessing the queue object outside the module. To address this issue and make the library more user-friendly, I implemented the missing return statement to expose the necessary properties and methods. My pull request (PR) includes the following changes: Added a return statement at the end of the createQueue function, returning an object containing the properties add, remove, clear, first, last, size, and queue. Now, developers can fully utilize the queue library and efficiently manage their data with the exposed functionalities. I am thrilled to have contributed to this open-source project and look forward to collaborating further on improving its capabilities. The code is now readily available for others to integrate into their JavaScript projects and benefit from the enhanced queue implementation.
1 parent acce706 commit 70746e0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -967,6 +967,7 @@ export function useQueue(initialValue = []) {
967967
first: queue[0],
968968
last: queue[queue.length - 1],
969969
size: queue.length,
970+
queue
970971
};
971972
}
972973

0 commit comments

Comments
 (0)