Add useEvictingQueue
middleware for keeping track of last N array state items
#35
Labels
enhancement
New feature or request
Motivation
Arrays used as state variables may have a desired length limit. The EvictingQueue data structure was just made with this purpose in mind. Encapsulating it in a hook as a middleware would allow its usage with any kind of state-returning functions (e.g.
useState
or evenuseLocalStorage
).Basic example
Details
Basic implementation idea:
The text was updated successfully, but these errors were encountered: