🐶 Learn JS Promises, with your friend 👑 Princess!

Overview

👑 I promise, Princess 💚

Hello, and welcome to my Promise Workshop, with 🐶 Princess as my helper!

🥳 Getting started

This is broken up into exercises. When you run the application, it'll go through each exercises one by one, if one fails it stops and tells you about it.

Currently, every exercise is broken. Let's fix them, with our trusty sidekick, Princess! She'll 🐽 sniff out hints, and leave marks on hints she found.

Most of the exercises are around interacting with a Princess or Doggo objects I created, isolated to the exercise.

🐊 Why alligators?

No, I do not feed Princess real 🐊 alligators. She's allergic.

You might not know this, but dogs often develop allergies to meats over their lifetime. So while 🐥 🐮 multi-source diets are healthier, single-source diets allow you to respond to allergies faster. For that reason it's often recommended to use single-source diets for dogs.

After Princess developed some allergies, and 🦌 import terrifs on less allergy-invoking meats were recognized, I reached out to some less common meats. Including, and you guessed it, 🐊 alligator. It's an understatement to say "she loved it".

Today, she does not eat alligators, but her love for it was actualized. And she became "the alligator hunter" in my view of her in my world. I often give her a treat called "alligator whimzees" a meat-free dental chew shaped like an 🐊 alligator.

alligator whimzee photo

🎮 Exercises

Each exercise is inside a folder in ./exercises with a simple setup.

.solution.js This will have a final solution, you could copy/ 🍝 pasta. However, it's recommended you only look if you're feeling stuck.

constants.js This will not need to be modified, but feel free to read the code if you're unsure how certain methods work.

index.js Will always be present, and is the only place you'll need to make changes.

module.exports = (assert) => {
  return ...; // the `return` is important!
}

The "module.exports" part 📸

This let's the exercise runner pull in your code easily, it's necesary and won't work w/o it.

The "return" 👀

Most exercises need to return a Promise so that the runner can execute them correctly. If you don't return you might get an error saying that the "assert count" was off.

The "assert" method 🤪

This is a very basic assertion library. It mirrors how console.assert works, but I made my own so I can do some special introspection for this workshop.

⚠️ You do not need to modify any assert statements for any of these exercises. ⚠️

It takes 2 arguments:

  1. The value to assert. Can be anything, but is often an operation, like triple equals.

  2. A short description. This makes it easy to communicate the intent of the test when reading it. This message appears in the output of a failed result.

😍 A passing test!

assert(1+1==2, '1+1 should be true!')

😞 A failing test!

assert(1+2==2, '1+1 should be true!')

🐶 Running

Clone and change to that directory:

git clone [email protected]:bayleedev/promise-princess.git
cd promise-princess

There are no node package dependencies. But, ensure you are using node 8.5 or newer in order for the perf_tools to be part of the core library.

Lyceum requests node 14, so you likely are already using a new enough verison.

node --version

To run, simply:

npm start

No need to keep your place, we'll do it for you. Just run the program and we'll pick up where you left off.

No worries, our friend Princess will help 💜

🚧 What is in that file?

./runner.js and ./src

So, sure, you could just open these file, there's some neat things in there, but you might run into some spoilers.

Open at your own learning risk!

You might also like...

Ajax library with XHR2, promises and request limit

qwest 4.5.0 ⚠ I finally decided to archive this repository. ⚠ At first, I developed Qwest because at the time other libraries were lacking of a proper

Sep 14, 2022

A request library that returns promises, inspired by request

then-request A request library that returns promises and supports both browsers and node.js Installation npm install then-request Usage request(metho

Nov 29, 2022

A polyfill for ES6-style Promises

ES6-Promise (subset of rsvp.js) This is a polyfill of the ES6 Promise. The implementation is a subset of rsvp.js extracted by @jakearchibald, if you'r

Dec 28, 2022

A Promise-compatible abstraction that defers resolving/rejecting promises to another closure.

Deferred Promise The DeferredPromise class is a Promise-compatible abstraction that defers resolving/rejecting promises to another closure. This class

Dec 15, 2022

Remembering promises that were made!

remember-promise A simple utility to remember promises that were made! It is greatly inspired by the p-memoize utility but with additional built-in fe

Dec 15, 2022

Follow along with blog posts, code samples, and practical exercises to learn how to build serverless applications from your local Integrated development environment (IDE).

Follow along with blog posts, code samples, and practical exercises to learn how to build serverless applications from your local Integrated development environment (IDE).

Getting started with serverless This getting started series is written by the serverless developer advocate team @AWSCloud. It has been designed for d

Dec 28, 2022

Learn to play the piano at your own pace through various modes of practice.

Learn to play the piano at your own pace through various modes of practice.

Piano Trainer Learn to play the piano at your own pace through various modes of practice. Features MIDI compatible Cross-platform support Interactive

Aug 25, 2022

Learn how to set up Supabase auth for both the frontend and backend of your application using a JWT - JSON web token.

Learn how to set up Supabase auth for both the frontend and backend of your application using a JWT - JSON web token.

Supabase auth, frontend + backend - example with Next.js Learn how to set up Supabase auth for both the frontend and backend of your application using

Nov 20, 2022

freeCodeCamp.org's open source codebase and curriculum. Learn to code for free.

freeCodeCamp.org's open source codebase and curriculum. Learn to code for free.

freeCodeCamp.org's open-source codebase and curriculum freeCodeCamp.org is a friendly community where you can learn to code for free. It is run by a d

Jan 7, 2023
Owner
Baylee Schmeisser
🌈 Pronouns: They/Them/Theirs 🐝 Schmeisser [ sm-eye-zur ] verb; to smile with your eyes.
Baylee Schmeisser
🌸 A fast and fun way to learn Japanese alphabets: hiragana & katakana. Don't wait - learn now!

Sakurator | Start learning 日本語 here Sakurator (Website publish date: ~4-6 April '22) - a personal trainer for learning Japanese alphabets (hiragana &

Anatoly Frolov 3 Jun 22, 2022
This Next.js app is designed to be used with the Figment Learn Pathways, to help developers learn about various blockchain protocols such as Solana, NEAR, Secret, Polygon and Polkadot!

???? What is learn-web3-dapp? We made this decentralized application (dApp) to help developers learn about Web 3 protocols. It's a Next.js app that us

t0nto 8 Oct 1, 2022
click your any waifu, or...... friend?

popwaifu Here is popwaifu.click backend project. Frontend project is on popwaifu-web run server Install Node.js I use 14.17.6 when writing this, recom

null 19 Feb 17, 2022
This is a tic-tac-toe game but differs from most others as it carries the option of playing against an AI (COM) or against a friend.

TIC-TAC-TOE This is a simple tic-tac-toe game with the exception of playing against an algorithm or against a friend. At the very start, you have to s

Paul Ibeabuchi C. 4 Jul 2, 2022
Friend Finder App, asks questions and recommends friends

Friendology Friend Finder app created as a Course Project for CS-522 Social Computing, at IIT Ropar. The application asks questions regarding lifestyl

Rohit Tuli 3 Apr 26, 2022
Crawl WeChat Moments and visualize friend interactions.

请注意:微信朋友圈内容可能涉及隐私,如果要使用本爬虫进行个人研究以外的其他活动,请仔细考虑可能带来的社会影响与法律后果。 使用方法: 配环境。 conda create -n friends conda activate friends conda install psutil conda inst

null 19 Nov 24, 2022
Jaime Gómez-Obregón 119 Dec 24, 2022
Run async code one after another by scheduling promises.

promise-scheduler Run async code in a synchronous order by scheduling promises, with the possibility to cancel pending or active tasks. Optimized for

Matthias 2 Dec 17, 2021
Resolve parallel promises in key-value pairs whilst maintaining type information

async-kv Resolves promises in key-value pairs maintaining type information. Prerequisites NodeJS 12 or later Installation npm i async-kv yarn add asyn

Tony Tamplin 4 Feb 17, 2022
Converts an iterable, iterable of Promises, or async iterable into a Promise of an Array.

iterate-all A utility function that converts any of these: Iterable<T> Iterable<Promise<T>> AsyncIterable<T> AsyncIterable<Promise<T>> Into this: Prom

Lily Scott 8 Jun 7, 2022