react-hooks-data-structures
v0.9.1
Published
This library provides you with basic data structures throught React hooks
Downloads
25
Maintainers
Readme
React Hooks Data Structures
The purpose of this project is to bring you basic data structures through React hooks.
Installation
Use the package manager npm to install react-hooks-data-structures.
npm i react-hooks-data-structuresUsage
import { useLinkedList } from 'react-hooks-data-structures/LinkedList';
const SomeComponent = (props) => {
const linkedList = useLinkedList();
const handleClick = useCallback((evt) => {
linkedList.add(evt.target.value);
}, []);
return (
<>
{linkedList.map((value, idx) => <Item key={idx}>{value}</Item>)}
</>
)
}
