GithubHelp home page GithubHelp logo

async-workshop's Introduction

Async workshop

Getting started

  1. Fork this repo so you can push your changes when you finish
  2. Make sure you have installed node v7.8.0
  3. Perform a npm i in the project folder.
  4. Code

Exercises

Refactor Callbacks

Edit callback.js:

  1. Refactor the solution using named functions. We'll need at least an uploadFile function for the following exercises.

Callbacks to Promises

  1. Copy the contents of callbacks.js into promises.js
  2. Change the uploadFile function so it returns a Promise
  3. We have installed fs-promise, a library that wraps fs and make it work with promises. Refactor the upload of the file with a chained promise.
  4. Change the way of waiting until all the files have been uploaded. Instead of a queue, we can now use Promise.all.

Promises to async/await

  1. Copy the contents of promises.js into async.js
  2. Refactor all the functions you can to the new async / await syntax and make sure the tests are passing.
  3. Try to figure out how to run the uploads in a serialized way instead of parallelized.

async-workshop's People

Contributors

arol 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.