Skip to content

Commit c8bc2e6

Browse files
committed
📝 fix some typos
1 parent b95daef commit c8bc2e6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/blog-md/2025/17-12/generator-generation.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Our end goal is going to be to define an abstraction that will allow us to conve
1212

1313
## Promises
1414

15-
Before diving into the complexity of generators, we're going to quickly kick off with a little introduction to `Promises` and how they relate to `async/await` and callback code
15+
Before diving into the complexity of generators, we're going to quickly kick off with a little introduction to `Promises` and how they relate to `async/await` and callback-based code
1616

1717
Promises are used to make async code easier to work with and JavaScript has some nice syntax - like `async/await` that makes code using promises easier follow and understand. They're also the common way to represent async operations which is exactly what we're going to use them for
1818

@@ -76,7 +76,7 @@ async function doWork(){
7676

7777
The `doWork` function returns `Promise`, this is because the `async` keyword is some syntax sugar for creating a `Promise`
7878

79-
### Promises vs Async
79+
### Promises Vs Async
8080

8181
For the sake of understanding, all that the `async` keyword does allow us to remove the `Promise` construction from our function - `async` functions are simply functions that return a `Promise` - these are alternative syntax for the same thing - so, the following two functions are the same:
8282

@@ -88,7 +88,7 @@ async function getNumber() {
8888
}
8989
```
9090

91-
Using an explict `Promise`:
91+
Using an explicit `Promise`:
9292

9393
```ts
9494
function getNumber() {
@@ -239,7 +239,7 @@ This also applies for the iterators above, I just find it so much more interesti
239239

240240
### Async Generators
241241

242-
Now, we're taking one more step - what if I wanted to do some long running task between each `yield`? This could be anything from waiting for a `Promise` to resolve, or a network request, or some user event (oh wow - there's an idea for multi-step forms!)
242+
Now, we're taking one more step - what if I wanted to do some long running task between each `yield`? This could be anything from waiting for a `Promise` to resolve, or a network request, or some user event (oh wow - there's an idea for multistep forms!)
243243

244244
Async Generators enable us to use promises in our iterators. Let's take a look at how we might define an async version of our `countTo` generator above:
245245

@@ -273,7 +273,7 @@ Let's start with the sync version
273273

274274
### Inside a Sync Generator
275275

276-
So if we re-define our `countTo` generator without using the `function*` and `yield` syntax sugar, we'll see something like this:
276+
So if we redefine our `countTo` generator without using the `function*` and `yield` syntax sugar, we'll see something like this:
277277

278278
```ts
279279
function countTo(max: number): Generator<number> {
@@ -388,7 +388,7 @@ Assume for whatever reason that we want to be able to take functions like this a
388388
function countIntervalGenerator(max: number): AsyncGenerator<number> {}
389389
```
390390

391-
For now, let's asume we've got a method called `createGenerator` that returns everything we need to hook up a generator and return it, this looks something like this:
391+
For now, let's assume we've got a method called `createGenerator` that returns everything we need in order to hook up a generator and return it, this looks something like this:
392392

393393
```ts
394394
function countIntervalGenerator(max: number): AsyncGenerator<number> {

0 commit comments

Comments
 (0)