Skip to content

Commit 03bfbd4

Browse files
committed
Fix arrow functions
1 parent 107c09a commit 03bfbd4

31 files changed

+43
-30
lines changed

.eleventy.cjs

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = function (eleventyConfig) {
2+
eleventyConfig.addFilter('code', (content) => {
3+
return content.replace(/=>/g, '=>');
4+
});
5+
6+
return {
7+
dir: {
8+
input: 'content',
9+
output: 'lessons',
10+
quiet: true,
11+
},
12+
};
13+
};

content/_includes/layouts/lesson.hbs content/_includes/layouts/lesson.njk

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ title: RxJS Fundamentals
77
<block name="title">{{title}}</block>
88
<block name="content">
99
<section class="lesson-content">
10-
{{{ content }}}
10+
{{ content | code | safe }}
1111
</section>
1212
</block>
1313
</extends>

content/basic-async.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Basic Async
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Making API calls is one of most common asynchornous actions that we do in our client-side applications. Naturally, RxJS comes with `fromFetch` to assist us when we're woring with APIs.

content/basic-observables.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Basic Observables
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Use write some tests to wrap our head around how the two, most basic ways to create observables work.

content/basic-operators-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Basic Observables — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
In `exercises/basic-operators.test.js`, there are a series of quick exercises. Your job is to make the tests pass.

content/basic-operators-solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Basic Observables — Solution
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Here is the solution to the suite of tests where we explored how to use some basic operators.

content/basic-operators.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Basic Operators — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
```js

content/counter-basic-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Counter (Basic) — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Alright, so we have a few new tricks up our sleeves.

content/counter-basic-solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Basic Observables — Solution
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Here is one possible solution.

content/counter-follow-along.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Counter — Follow Along
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
If the purpose of using RxJS is to play around with time, then it makes sense to kick the tires on it by building a simple timer, right? Well, I think so anyway.

content/counter-starting-and-stopping-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Counter, Starting and Stopping — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Alright, so we have a few new tricks up our sleeves.

content/creating-observables-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Creating Observables — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
We have a set of tests in `exercises/creating-observables.test.js`. You can run just these tests using the the following.

content/creating-observables-solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Creating Observables — Solution
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
```js

content/fetching-dog-facts.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Fetching Dog Facts
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Let's start with our endpoint.

content/first-and-last-name.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: First and Last Name — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Functions and operators used:

content/from-event-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: fromEvent — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
## Your mission

content/from-event-solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: fromEvent — Solution
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
This one is pretty simple and it's not _that_ much different than just using an event listern. But, we're building to something bigger. I promise.

content/loading-state.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Loading State
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
We need some amount of DOM manipulation:

content/manipulating-time-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Manipulating Time — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Most applications that have some kind of autosave functionality don't automatically save your work on every keystroke. Instead, they will save at regular intervals.

content/manipulating-time-follow-along.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Manipulating Time — Follow Along
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
We're mostly just trying to get familiar with the `delay`, `throttleTime`, and `debounceTime` operators here. So, let's get to experimenting, shall we?

content/manipulating-time-solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Markdown Renderer — Solution
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Our first pass might look something like this:

content/mapping-follow-along.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Adventures in Mapping — Follow Along
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Whether it's with arrays or observables, mapping values is a common endeavor. So far in this workshop, we've mapped values into other values, but things can get a little tricky when we want to map values into other observables.

content/merging-timelines-follow-along.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Merging Timelines — Follow Along
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
We're going to get a bit meta here for a moment and we're going to build the tooling that we're going to use to explore some of the functions for combining observables.

content/pixel-editor.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Pixel Editor
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
```js

content/pokemon-fetching.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Fetching Pokémon
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
Okay, let's start with the basics:

content/progressive-data-enhancement.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Progressive Data Enhancement
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
We've all been there. You get some of the base amount of data from on API but you have to hit _another_ API to get everything you need. This should literally be my job description.

content/subjects.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Subjects
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
In the past, we saw that each observer got it's own special and unique subscription to an observable.

content/switch-map-exercise.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: Switch Map — Exercise
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---

content/switch-map-solution.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
title: Switch Map — Solution
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---

content/switch-map.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Switch Map
3-
layout: layouts/lesson.hbs
3+
layout: layouts/lesson.njk
44
---
55

66
So, in a previous example. I had those nifty "Start" and "Pause" buttons working. How did I do that? Was I subscribing and unsubscribing between observables?

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"test": "jest --watch",
1111
"build": "npm run build-lessons && npm run build-site",
1212
"build-site": "parcel build index.html lessons/**/*.html",
13-
"build-lessons": "eleventy --input=content --output=lessons --formats=md,html,ejs",
13+
"build-lessons": "eleventy --config=.eleventy.cjs",
1414
"lessons": "npm run build-lessons -- --watch",
1515
"all": "concurrently \"npm:ui\" \"npm:api\" \"npm:lessons\""
1616
},

0 commit comments

Comments
 (0)