Skip to content

Commit 0c9c0d4

Browse files
committed
Article edits
1 parent 706b439 commit 0c9c0d4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

blog-post.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ I'll show examples of defining custom generics in a minute.
123123

124124
## The case for generics
125125

126-
Let's say you need a another function to call a different endpoint,
126+
Let's say you need another function to call a different endpoint,
127127
this time to fetch user roles:
128128

129129
<pre class="language-ts">
@@ -246,7 +246,7 @@ This required a bit more code and we now have a
246246
[type constraint](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints)
247247
(via the `extends` keyword)
248248
to denote the object shape.
249-
Specifically, we're saying `request()` takes a type variable `<D>` which
249+
Specifically, we're saying `request()` takes a type variable `D` which
250250
is an object having the keys `BodyType` and `ResponseType`.
251251

252252
Let's define a function to make a `GET` request:
@@ -286,14 +286,14 @@ with `any` types but there are still valid cases for them.
286286
If you're converting a legacy code base to TypeScript,
287287
falling back on `any` is a powerful way
288288
to maintain forward momentum.
289-
Converting a large code base to TypeScript could take a long time.
289+
Converting a large code base could take longer than you think.
290290
It's a good investment but it still takes time away from shipping
291291
product features so one often has to do it incrementally.
292292

293293
There are other powerful
294294
[escape hatches](https://www.typescriptlang.org/docs/handbook/type-checking-javascript-files.html)
295295
in TypeScript
296-
like `@ts-ignore` or `@ts-nocheck`.
296+
like `@ts-ignore` and `@ts-nocheck`.
297297
I'm a big fan of
298298
[spike, test, break, fix](http://farmdev.com/thoughts/113/spike-test-break-fix/)
299299
development.
@@ -317,13 +317,13 @@ for more details.
317317
I also provided some lint rules to help keep a codebase safe as it evolves.
318318
All of this has to be enforced with
319319
[continuous integration](http://farmdev.com/thoughts/114/if-it-s-not-in-ci-it-doesn-t-exist/)
320-
to add lasting value to your team.
320+
for it to add lasting value.
321321

322322
If you'd like to play around with these code examples,
323323
I've made them
324324
[available](https://github.com/kumar303/safer-typescript-examples).
325325
However, they are just examples.
326-
Rather than building a type safe API from scratch,
326+
Rather than building a type safe API client from scratch,
327327
check out
328328
[axios](https://github.com/axios/axios).
329329
It supports TypeScript and is

0 commit comments

Comments
 (0)