Day 77-80 of #100DaysOfCode Day 77 📍I learnt that useReducer can be refactored with Immer which allows for mutation of code. It is not a best practice. It is just okay to be aware that such exist. 📍Redux library is a javascript library that is quite similar to useReducer. 📍In Redux, there are many reducer functions as opposed to useReducer which has only one reducer function. 📍Redux has complex state objects. 📍 Redux Toolkit helps simplify the state and action creation process in Redux; It reduces the amount of boilerplate codes to write. 📝A more significant part of useReducer and Redux is the dispatch function. Dispatch function helps to easily track changes in states. Day 78 To access state in Redux: 📍Find the component that needs to access some state; 📍Import the 'useSelector' from react-redux; 📍Call the hook, passing in a selector function; 📍Use the state. Anytime state changes, the component will re-render. Day 79 📍Learnt how to do manual action creation in Redux 📍Understood file organisations (organising files/folders either by feature or by function) 📝Redux docs recommend feature approach which doesn't work well with Redux-Toolkit. Day 80 I was able to implement organising folders and files by features such as: 📍Components & 📍Store, where we have: 👉songsSlices & 👉moviesSlices, as files 📍action.js where createAction was imported and manual action was created. #connect #reactjs
Babatunde Akintola’s Post
More Relevant Posts
-
⛅ 𝐃𝐚𝐲𝟖: 𝐄𝐒𝟔+ 𝐅𝐞𝐚𝐭𝐮𝐫𝐞𝐬 🚀 Day 8 of 21 days javaScript challenge! Topic : ES6+ Features 𝐀𝐜𝐡𝐢𝐞𝐯𝐞𝐦𝐞𝐧𝐭 𝐨𝐟 𝐃𝐚𝐲𝟖 : End of the day 8 activities and tasks, i: • Understood and used template literals for string interpolation and multi-line strings. • Applied destructuring to extract values from arrays and objects. • Utilized spread and rest operators for array manipulation and function arguments. • Defined functions with default parameters. • Created objects** using enhanced object literals, including methods and computed property names. Check GitHub for 𝐃𝐚𝐲 𝟖 tasks : https://lnkd.in/di9RzBQV hashtag #JavaScript #CodingChallenge #WebDevelopment #LearningJourney #JavaScriptChallenge #21DaysOfCode
To view or add a comment, sign in
-
🚀 Completed Day 8 of the 30-day JavaScript challenge! Today's agenda: ES6+ Features Practices 1. Template literals for string interpolation and multiline strings. 2. Destructuring arrays and objects. 3. Spread operator for arrays and objects; rest operator in functions. 4. Default parameters in functions. 5. Enhanced object literals: shorthand properties, methods, and computed properties. Building solid foundations step by step! 💻 Follow my GitHub journey here: https://lnkd.in/gk4ZvcTF. I'm excited for the next challenges ahead! 💪 #JavaScript #CodingJourney #30DaysOfCode #DeveloperLife #30daysjavascriptchallenge
To view or add a comment, sign in
-
🔴 Day 24 of #30daysofcode : Excited to share my progress on Day 24 of the #30DaysOfCode challenge! Today, I created a Color Changeable Navbar Website using the power trio of HTML, CSS, and JavaScript. 💻 Along with i solved (valid-anagram) which is based on Hash Table, String, Sorting. https://lnkd.in/gJUnvmXf Stay tuned for more updates as I continue my coding journey! 🔥 Let's keep pushing boundaries and mastering new skills together. 💪 #HTML #CSS #JavaScript #WebDevelopment #CodingJourney #30daysofcode #30daysofcodechallenge #dailylearning #30days30project #dailyprogress Project No :- MPR-24
To view or add a comment, sign in
-
Day 30: Wrapping up My 30 Days of JavaScript Challenge on LeetCode! 🎉 Today’s challenge was the Calculator with Method Chaining problem, which focused on implementing a calculator with basic operations and allowing method chaining for consecutive calculations. Problem: The task was to create a Calculator class with methods for: Addition, subtraction, multiplication, division, and exponentiation Each operation should return the Calculator instance to support chaining. Handle division by zero with an error message. Use getResult() to retrieve the final result after chaining operations. Solution: I implemented each operation as a method within the Calculator class, with each method returning this to enable chaining. For division, I added error handling to ensure division by zero throws a clear message. The final result is obtained using getResult(). This challenge tested my knowledge of JavaScript classes, chaining methods, and error handling, and I’m thrilled with how the solution turned out! 🎉 Feeling super accomplished on reaching the last day! This journey has definitely leveled up my JavaScript skills. On to the next challenge! 🚀 #JavaScript #LeetCode #CodingChallenge #30DaysOfCode #Day30 #MethodChaining #WebDevelopment #LearningJourney
To view or add a comment, sign in
-
👋 Day 36 of my JavaScript journey: Today, I explored some essential features that make code cleaner and more efficient: 1. Default Parameters – Learned how to set default values for function parameters, making functions more robust. 2. Spread Operator – Practiced using spread (`...`) with arrays and objects to easily copy or combine data. 3. Rest Operator – Used rest (`...`) to handle variable numbers of arguments, which is especially helpful in functions. 4. Destructuring – Learned array and object destructuring to quickly unpack values from arrays and properties from objects, streamlining code readability. #100DaysOfCode #JavaScript #WebDevelopment #LearningInPublic #CareerGrowth
To view or add a comment, sign in
-
🚀 Just completed Day 8 of the "30 Days of JavaScript Challenge" hosted by Hitesh Choudhary on Chai Aur Code! 🎉 Hello LinkedIn Family! Another day, another step closer to JavaScript mastery! 💪 Just wrapped up Day 8 of Hitesh Choudhary sir's amazing #30DaysofJavaScript challenge on Chai aur Code. Today, I delved into the world of ES6 and it's been a game-changer! 💻 I've got a better grasp of : 👉 Template Literals : Improved string manipulation and embedding expressions. 👉 Array and Object De-Structuring : Streamlined data extraction and assignment. 👉 Spread and Rest Operators : Simplified function arguments and array manipulations. 👉 Default Parameters : Enhanced function flexibility with default values. 👉 Enhanced Object Literals : Cleaned up object creation and property shorthand. 💻 You can find code here : https://lnkd.in/g_PfMszD This challenge has been an incredible journey so far, and I'm excited to continue expanding my JavaScript skills. Big thanks to Hitesh Choudhary sir for his engaging and insightful lessons. #JavaScript #LearningJourney #CodingChallenge #ContinuousImprovement #30DaysOfJavaScript #ChaiAurCode
To view or add a comment, sign in
-
🎉 Exciting News! I've just completed an intensive JavaScript course from Chai aur Code! 🚀 This journey has been incredibly rewarding, deepening my understanding of JavaScript and its powerful capabilities. Here's a glimpse of what I've learned: 📌 Document Object Model (DOM) 🛠️ 6 Hands-on Projects 🔄 Event Handling ⏳ Asynchronous JavaScript 🌐 API Management 🤝 Promises ...and much more! The course provided a detailed learning curve, offering both theoretical knowledge and practical application. I'm excited to apply these skills in real-world scenarios and continue growing as a developer. 🔗 For fellow developers and tech enthusiasts: I've compiled all my learnings, code snippets, and projects in my GitHub repository. Feel free to check it out for reference or collaboration! https://lnkd.in/gpvF4nCu Thank you, Chai aur Code, for this comprehensive learning experience. Looking forward to leveraging these skills in my next project! #JavaScript #WebDevelopment #CodingJourney #ChaiAurCode #ContinuousLearning #TechSkills
To view or add a comment, sign in
-
Day 3 of my 30-day of coding trip down memory lane with Vanilla Javascript done. Today I explore the world of arrays and objects. I learned more about arrays and objects. I built a simple To-Do List app that demonstrates my understanding of these data structures. I uses arrays to store the tasks and objects to represent each task with its properties (text, completed). #VanillaJS #JavaScript #30daysofcode #Arrays #Objects Below is the github repo for the source code: https://lnkd.in/dcQySM-F
To view or add a comment, sign in
-
👨💻 Leet Code Problem - 1773. Count Items Matching a Rule 🚀🔥 This morning, I solved the LeetCode problem "1773. Count Items Matching a Rule" using JavaScript/TypeScript. This problem involves counting the number of items in a list that match a given rule, where the rule is defined by a key-value pair. To solve this problem, I explored different approaches to optimize the code for readability and memory usage. I tried three different solutions: 1. Using a for...of loop. 2. Using the filter method. 3. Using the reduce method. - Time Complexity -->Solution 1 (for...of loop): O(n), where n is the length of the items array, as we need to iterate through the entire array. --> Solution 2 (filter method): O(n), as we need to iterate through the entire array to filter the matching items. -->Solution 3 (reduce method): O(n), as we need to iterate through the entire array to count the matching items. - Space Complexity --> Solution 1 (for...of loop): O(1), as we only use a constant amount of extra space to store the result variable. --> Solution 2 (filter method): O(n), as we create a new array with the filtered items. --> Solution 3 (reduce method): O(1), as we only use a constant amount of extra space to store the count variable. In terms of readability and memory usage, the three solutions have their own trade-offs. The filter method solution is more concise and readable, but it creates a new array, which may have a higher memory usage. The reduce method solution is also readable and has a lower memory usage, as it only uses a constant amount of extra space. If you're interested in seeing the solution and the code, you can access my GitHub repository at https://lnkd.in/gpxhiNHq. I highly recommend practicing these tree problems to level up your skills. They really help strengthen your problem-solving abilities. Let me know if you have any other questions! Happy to discuss further. #LeetCode #JavaScript #TypeScript #Algorithms #DataStructures #CodeOptimization #MemoryUsage #Readability #ProblemSolving #CodingChallenge #TechTips #CareerGrowth #SoftwareDevelopment
GitHub - warranttsai/leetcode-problems: This repository is used to save my codes of Leetcode problems.
github.com
To view or add a comment, sign in
-
⛅ 𝐃𝐚𝐲 𝟏 : 𝐕𝐚𝐫𝐢𝐚𝐛𝐥𝐞𝐬 𝐚𝐧𝐝 𝐃𝐚𝐭𝐚 𝐓𝐲𝐩𝐞𝐬 🚀 Day 1 of 21 days javaScript challenge! Topic : Variables and data types 𝐀𝐜𝐡𝐢𝐞𝐯𝐞𝐦𝐞𝐧𝐭 𝐨𝐟 𝐃𝐚𝐲 𝟏 : End of the day 1 activities and tasks, i: • know how to declare variables using 𝐯𝐚𝐫, 𝐥𝐞𝐭 and 𝐜𝐨𝐧𝐬𝐭. • Understood the different data types in JavaScript. • able to use the 𝐭𝐲𝐩𝐞 𝐨𝐟 operator to identify the data type of a variable. • Understood the concept of variable reassignment and the immutable of 𝐜𝐨𝐧𝐬𝐭 variables. Check GitHub for 𝐃𝐚𝐲𝟏 tasks : https://lnkd.in/di9RzBQV #JavaScript #CodingChallenge #WebDevelopment #LearningJourney #JavaScriptChallenge #21DaysOfCode
To view or add a comment, sign in
Way to go, Babatunde Akintola! Your determination knows no bounds! Your progress speak volumes about your character and drive. Keep pushing forward and always remember that you have the power to achieve anything you set your mind to! We're rooting for you! 🌟👊