• Stars
    star
    736
  • Rank 61,564 (Top 2 %)
  • Language
    JavaScript
  • Created about 11 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Workshopper module that teaches you to use promises in javascript

Promises Workshop for JavaScript!

Learn to wield promises like a master to write clean asynchronous code

Uses ECMAScript 6 Promises

Dependency Status

Promise it won't hurt

Mission

Promises offer a very powerful abstraction for obtaining values asynchronously.
As JavaScript is a async-first language it is important to understand the options you have for handling asynchronicity.

You will learn the ins and outs of promises including error handling, value propagation, synchronous returns, and composition.

By the end of the workshop you will be comfortable using ES6 promises AND writing your own functions that leverage promises to provide clean abstractions and error handling.

Installation & Update

There are two ways to run the workshop:

1. NPM

Create a new directory to do your workshop work in. Let's call it "promise-shop". You will need to initialize npm in this repo.

$ mkdir promise-shop && cd promise-shop
$ npm init
$ npm install -g promise-it-wont-hurt@latest

Note: the workshop is being updated weekly. Please regularly rerun the above command to get the latest set of exercises.

2. Docker

Note for beginners: Do not do this if you do not have docker installed.

alias promise-it-wont-hurt='docker run -it -v $(pwd):/root oreng/promises-workshop'

promise-it-wont-hurt                        # show menu
promise-it-wont-hurt run mysolution.js      # run your solution
promise-it-wont-hurt verify mysolution.js   # verify your solution

The workshop stores your progress in .config so sudo rm -r .config will reset the workshop!

Usage Instructions

1. Selecting a problem to work on

Once the workshop is installed, run promise-it-wont-hurt to print a menu where you can select a problem to work on.

$ promise-it-wont-hurt

Problems are listed in rough order of difficulty. You are advised to complete them in order, as later problems will build on skills developed by solving previous problems.

2. Writing your solution

Once you have selected a problem, the workshop will remember which problem you are working on. Using your preferred editor, simply create a file to write your solution in.

3. Testing your solution

Use the workshop's run command to point the workshop at your solution file. Your solution will loaded and passed the problem input. This usually won't perform any validation, it will only show the program output.

$ promise-it-wont-hurt run mysolution.js

4. Verifying your solution

Your solution will be verified against the output of the 'official' solution. If all of the output matches, then you have successfully solved the problem!

$ promise-it-wont-hurt verify mysolution.js

Stuck?

Feedback and criticism is welcome, please log your troubles in issues.

Thanks rvagg

This tutorial was built using rvagg's workshopper framework.

Licence

MIT

More Repositories

1

fluid

Implementations of fluid simulations for the web
HTML
6
star
2

regl-typescript

Quick example of how to setup a simple regl and typescript project
TypeScript
3
star
3

breakout

breakout game
JavaScript
3
star
4

ember-calendar-component

This is a datepicker calendar component for ember.js
JavaScript
3
star
5

unity-pbd-tests

PBD tests in Unity
C#
2
star
6

raf-shim

Tiny tested request/cancel animationFrame shim designed for consumption via npm/browserify
JavaScript
2
star
7

play

This is an example setup for building browser applications and packages
JavaScript
2
star
8

dom-scenegraph

DOM-based 2d scene graph
JavaScript
2
star
9

keyboard-signal

Turn your keyboard into queryable data structure
JavaScript
2
star
10

normal-mapping

Quick example of implementing normal mapping
JavaScript
2
star
11

prodash

A functional utility library in the spirit of lodash but designed with functional programming in mind
JavaScript
2
star
12

ts-adt

Common Algebraic Data Types for Typescript
TypeScript
1
star
13

hskl

This is a dumping ground for learning haskell and functional javascript. prepare yourself
Haskell
1
star
14

webgl-obj-viewer

A simple .obj file viewer written in javascript and GLSL (webgl)
JavaScript
1
star
15

ldjam

Ludum Dare Jam game
JavaScript
1
star
16

GameJam2022

A short action game made in three(maybe?) days
C#
1
star
17

lttp

multiplayer web game using es6ify, browserify, and phaser
JavaScript
1
star
18

CardTricks

Card tricks repo for learning swift and spritekit
Swift
1
star
19

graph-clone

Playground for conditional cloning techniques in JS
JavaScript
1
star
20

lightning

Lightning tests glsl
JavaScript
1
star
21

nodebase

This is a node base for building ember.js applications with grunt toolchain
CoffeeScript
1
star
22

ecs-core-systems-tests

Test of Unity.NetCode, Unity.Animation, Unity.Entities, Unity.NavMeshQuery, etc
C#
1
star
23

shotgun

HTTP server that queues requests for web page capture via Phantomjs
JavaScript
1
star
24

AsyncReadback

Async Readback Unity
C++
1
star
25

ember-powercore

This is an excellent base for ember.js applications using a gruntfile that streamlines a ton of your boring work
CoffeeScript
1
star
26

mouse-signal

Convert mouse to signal that can be queried. Also provide child listeners that scope data to DOM-nodes
JavaScript
1
star
27

Blog

Here lies a blog
1
star
28

bookmarklet

This is a playground for experimenting with bookmarklet design
JavaScript
1
star
29

videosite

Ember.js videosite
JavaScript
1
star
30

from-camera

Regl library for easily drawing from several kinds of cameras with nice defaults and options
JavaScript
1
star
31

webgl-playground

This is a playground for learning about webgl by building up custom APIs from the raw WebGL api
JavaScript
1
star
32

precompiled-template-recipe

An Ember.js cookbook recipe for pre-compiling your handlebars templates
JavaScript
1
star
33

math-game

This is a multiplayer mathematics flashcard game using web sockets
JavaScript
1
star
34

shades-of-play

GPGPU Playground
JavaScript
1
star
35

jam

A functional component-entity-system game architecture and library for building web games and Chrome apps
JavaScript
1
star
36

lerp-tests

Quick test of lerp functions
JavaScript
1
star
37

sweetjs-browserify-gulp

This is a demonstration of using sweet.js, gulp, and browserify
JavaScript
1
star
38

ode-gpu

Examples of solving Ordinary Differential Equations on the GPU
JavaScript
1
star
39

big-triangle

Create array of vertices for a "big triangle"
JavaScript
1
star
40

pbd

Position Based Dynamics implementations
HTML
1
star
41

contour

2-D Signed-distance field drawing tool
JavaScript
1
star
42

Sample-Games-and-Architectures

Examples of several complete games built in Unity following different architectural designs
C#
1
star
43

monad-playground

This is a monad playground
JavaScript
1
star
44

PBD-Unity

Lets do this
C#
1
star
45

Kane-Lang

Implementation and specification of Kane programming language
Haskell
1
star