Skip to main content

Posts

The Complete Guide React by Maximilian - #1 : Getting Started

7. About this course & course outline  Basics & Foundation of React (Introducing key features) Component & Building UIs Events & Data "props" and "state" Styling React Apps & components Styling React Apps & Hooks Advanced concepts   Side Effects. "Refs" & More React Hooks React Context API & Redux Forms HTTP Requests & "Custom Hooks" Routing, Deployment, NextJS & More Summaries & Refreshers  JS Refresher React Summary 

Forkify - Vanilla JS

282. Loading a Recipe from API async/fetch const   showRecipe   =   async   function  () {    try  {      renderSpinner ( recipeContainer );      // 1) Loading recipe      const   res   =   await   fetch (        'https://forkify-api.herokuapp.com/api/v2/recipes/5ed6604591c37cdc054bc886'     ); 283. Rendering the recipe  after making markup html code       recipeContainer . innerHTML   =   '' ;      recipeContainer . insertAdjacentHTML ( 'afterbegin' ,  markup ); 284. Listening for load and hashchange events dynamic id after removing '#' with slice(1)      const   id   =   window . location . hash . slice ( 1 );      renderSpinner ( recipeContainer );      //...

How to get Input case data in Node.JS

Every website provides a different skeleton code to start with.  BOJ const   input   =   require ( "fs" ). readFileSync ( "/dev/stdin" ). toString ( ' \n ' ); console . log ( input ); Programmers - just focus on the code itself, solution function for the logic function   solution ( numbers ) {      var   answer   =  [];      return   answer ; } Groom  const   readline   =   require ( "readline" ); const   rl   =   readline . createInterface ({    input :  process . stdin ,    output :  process . stdout , }); let   data   =  []; rl . on ( "line" ,  function  ( line ) {    data . push ( line );    //console.log(data);    data   =   line . split ( " " ). map (( el )  =>   el );    console . log ( data );    // data =...

JavaScript Patterns, including MVC

 JavaScript Patterns  1. Module & Revealing Module pattern  // STANDARD MODULE PATTERN - private/public variable const UICtrl = ( function () { let text = "Hello world" ; const changeText = function () { const element = document . querySelector ( "h1" ) ; element .textContent = text ; }; // public which is accessible from outside return { callChangeText : function () { changeText () ; console . log (text) ; } , }; } )() ; UICtrl . callChangeText () ; 2. Singleton pattern  it can only return one instance of an object at a time  3. Factory pattern Creating an interface for creating objects  MVC Pattern  It is consist of with following Model, View, Controller.  M odel take responsibility for data(application info) like data structure.  V iew represent for UI.  C ontroller is like a bridge between Model and View. They don't know each other. So it does monitor the change of Model ...