Hash table
Very simple code Modern code Junior friendly Typescript Made with 💛
yarn add @onesy/hash-table
- Indexing data
- Caching
- Storage for data, for efficient quering
- Storing relationships between data
- etc.
import OnesyHashTable from '@onesy/hash-table';
// Make a new hash table instance
const onesyHashTable = new OnesyHashTable();
// Add values
onesyHashTable.set('a', 14).set('a1', 114);
onesyHashTable.get('a');
// 14
onesyHashTable.get('a14');
// undefined
// Remove
onesyHashTable.remove('a');
// true
onesyHashTable.get('a');
// undefined
Install
yarn
Test
yarn test
Build
yarn build