Giter VIP home page Giter VIP logo

async-programming-promises's Introduction


Good evening everyone. 

If you are reading this , you have been challenged.  

simple running a promise with 
npm run dev , to host your own server , 
and display the flag in the console. 

- Capture the flag.  

03/06/2023-3:37pm 
, I have left specific notes for you on 
creating.mjs     - ( which is just a js file  thats a module by default , )
lines 
88 - 114
is what I covered earlier and is a easy and proper means 
of  using multiple promises to be fulfilled at one time. 

its a Promise.All or Promise.all . 
------
To run the file again , use npm run dev in a console once 
you open in vs code ( or whatever else that has a console that may run it. )

 , may have to install axios using nom install axios , however , 
 there is a local file in here that supports is. 

 Half of all the stuff is exported so the code is super duper short , 
-----------------------
Once you get the file up and running locally - ( its set to port :3000 now ,  
 you can go there and go too localhost:3000 and localhost:3000/home respestively.)


----- To find out how the demonstration works , 
- run npm run dev , host the site locally. 
 - visit the site at localhost:3000/home , 
     navigate to the , 
      localhost:3000/creating page. and examine the console code when you hit the 

      ALL button.   If your server is running properly 
        you will see the multiple promises create and execute
        and you will have this in your console  , 


 if you need help just ask , 
          capture the flag , and ,  
             - good luck.  



























=========================================================================
extra notes i decided to leave ........... 


// This funtion exports a function that calls the counter until two and then , 
when the function is sert to an onclick buttton , 
the interval is increased every time , plus the 
regulaar interval , making the count faster and faster. ---------------------------

export function clearIntervalChain(){
/    let counter = 2; 
const wait = new Promise((resolve) => {
  
    setInterval(() => {
        let interval; 
        console.log ("interval")
        resolve(`Timeout! ${++interval}`);
        } ,1500); }  );  
    
     wait.then(text => setText(text))
    
    .finally(() =>  appendText(`--Done ${interval}`) ) 

    }  
/

async-programming-promises's People

Contributors

vampeyer avatar

Stargazers

Johnathan brown avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.