Author: Prathu Tiwari
Promises are used to handle async operations in JavaScript. Promises are nothing you can assume it to be an empty object or some data in it. Promises give us the guarantee that it will call the callback function whenever there is data in the promise object. JavaScript guarantees that a promise will be called only once whether it’s a failure or success. There are majorly four promise APIs -Promise.all() => If you have to make parallel API calls it will wait for all of them to finish and get the result. As soon as any of the APIs in Promise.all…
useMemoIt is a react hook that lets you cache the calculation results between re-renders.Problem ⇒ React renders the component on every state change so if we are doing some heavy operation it will render the component with the whole operation on every small change also. Solution ⇒ Such type of issue can be solved with the help of memoization or useMemo. That means it caches the heavy operations calculations between every re-renders.useCallbackIt is a react hook that lets you cache a function definition between re-renders.useRefIt is a react hook that lets you reference a value that’s not needed for rendering.When…
Contact Us
Subscribe to Stay Updated
Stay ahead in the world of tech with our exclusive newsletter! Subscribe now for regular updates on the latest trends, valuable coding resources, and tips to boost your frontend development skills.