JavaScript

  • Guide to Using Promises and Async/Await in JavaScript and ReactJS

    Guide to Using Promises and Async/Await in JavaScript and ReactJS

    This guide provides best practices for using Promises and async/await in JavaScript and ReactJS, including examples of consuming REST APIs and tracking errors. The guide will be structured as follows: 1. Introduction to Promises Promises in JavaScript provide a way to handle asynchronous operations. A Promise represents a value that may be available now, or…

  • Day 7: Final Touches and Create tests for some components

    Day 7: Final Touches and Create tests for some components

    For testing the Vue component, we can utilize the Vue Test Utils and Jest. Vue Test Utils allows for mounting Vue components in isolation and simulating user interactions, while Jest can be used for assertions to ensure everything is working as expected. Firstly, set up your Vue project to use Jest (assuming you’re using Vue…

  • Day 5: Integrating Frontend with Backend

    Day 5: Integrating Frontend with Backend

    Create axiosConfig.js Modify api-be.js Create vue file ItemsCallFromAxios.vue Modify router with previous file Add this line on App.vue if you have checkout exercise complete https://github.com/LeoReyesDev/vue-tutorial/tree/day05-sample

  • React Hooks

    React Hooks

    React hooks are a powerful feature introduced in React 16.8, enabling developers to use state and other React features without writing a class. Here’s a list of some of the built-in React hooks with simple examples for each: 2. useEffect 3. useContext 4. useReducer 5. useCallback 6. useMemo 7. useRef 8. useLayoutEffect 9. useImperativeHandle 10.…