Learning Cloud Functions for Firebase (video series)
Getting Started with Cloud Functions for Firebase using TypeScript
Cloud Functions for Firebase lets you automatically run backend code in response to events triggered by Firebase features and HTTPS requests. Watch this video to get started writing functions using TypeScript and deploying them with the Firebase CLI.
If you’re going to write code for Cloud Functions, you definitely need to know about how promises work. Nearly all the functions you write will use promises, and, if you don’t do it correctly, your code may fail in mysterious ways. In this tutorial, you’ll learn the basics of using promises in your HTTP functions.
How do you correctly terminate a background function? You must return a promise that becomes fulfilled or rejected when all the pending work in that function is complete. Let's see what that looks like with a Firestore trigger.
How do you perform multiple items of asynchronous work in Cloud Functions? In this video, you'll see how to chain work sequentially with promises, and also how to manage work in parallel with
Promise.all(). These are the building blocks you'll need to write advanced code with Cloud Functions for Firebase.
How does async/await work with TypeScript and ECMAScript 2017?
Did you know that async/await syntax can make your TypeScript (and ECMAScript 2017) easier to read and write? Check out this first of two tutorials to learn async/await for use with Cloud Functions.
Use async/await with TypeScript in Cloud Functions for Firebase
Using async/await syntax with Cloud Functions for Firebase can make your TypeScript and ECMAScript 2017 code easier to read and write. In this part 2 video, Doug shows how to convert some functions that use promises to use async/await instead.
Realtime Database triggers (pt. 1) with Cloud Functions for Firebase
Cloud Functions allows you to write code that responds to changes in Realtime Database. This video explains how these triggers work on the backend and focuses on the
onCreate event handler, which triggers when new data is created in the database.
Realtime Database triggers (pt.2) with Cloud Functions for Firebase
The first video in our database trigger mini-series showed how to implement a database trigger using
OnCreate, which triggers on new documents. But what if you want to implement triggers on existing documents that are modified? Find out in this video covering the
Realtime Database triggers (pt. 3) with Cloud Functions for Firebase
In this video, lean how an
onDelete trigger works with Cloud Functions for Firebase, and how to handle race conditions.