const callback =useCallback(()=>{// i use toLowerCase() in code, so it doesn't matter, if you use 'Enter' or 'enter'
console.log('npm.piece')},[])useOnKeyPress(callback,'Enter')
The Service Injector component is designed to inject custom hooks containing useEffect, to your application without calling re-render of child components.
This component is a generic component for displaying an array of elements. Instead of just using map to convert an array of elements into JSX elements, the ArrayRender component takes an array of items and a renderItem function and processes them internally. The main purpose of this component is to simplify repetitive code when displaying a list of items and keep the code clean and modular.
const a ={name:'npm.piece',location:{city:'City 17'}}const b ={age:18,location:{flat:'H15'}}const c ={price:100}const d =mergeObjects(a, b, c)// d will be:const d ={name:'npm.piece',age:18,price:100,location:{city:'City 17',flat:'H15'}}
useEffect(()=>{construnIndexDb=async()=>{const idb =newIndexedDB('test')//if you need to delete database, add new version number for second argumentawait idb.createObjectStore(['languages','students'],1)await idb.putValue('languages',{ name:'JavaScript'})await idb.putBulkValue('languages',[{ name:'TypeScript'},{ name:'C#'}])await idb.getValue('languages',1)await idb.getAllValue('languages')await idb.deleteValue('languages',1)}runIndexDb()},[])