File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -279,6 +279,21 @@ Here's a function that makes a `POST` request:
279
279
280
280
This defines ` D ` where both ` BodyType ` and ` ResponseType ` are a ` User ` .
281
281
282
+ ## Bolt-on solutions
283
+
284
+ I've shown how out of the box TypeScript isn't very safe and presented
285
+ some techniques for making it safer.
286
+ I also suggest hunting for third party libraries
287
+ that seek to specifically address type safety, as there are quite a few.
288
+
289
+ One in particular,
290
+ [ io-ts] ( https://github.com/gcanti/io-ts )
291
+ helps make ` fetch() ` and other common I/O patterns type safe.
292
+ When working in
293
+ [ Redux] ( https://redux.js.org/ ) ,
294
+ [ ` typesafe-actions ` ] ( https://github.com/piotrwitek/typesafe-actions )
295
+ adds type safety to actions as well as reducers, for example.
296
+
282
297
## The case for any types
283
298
284
299
Hopefully by now I've convinced you not to build a TypeScript app
@@ -328,3 +343,8 @@ check out
328
343
[ axios] ( https://github.com/axios/axios ) .
329
344
It supports TypeScript and is
330
345
[ designed for type safety] ( https://levelup.gitconnected.com/a-typescript-safe-api-82cc22c4f92d ) .
346
+
347
+ To go further, here is a
348
+ [ deep dive] ( https://basarat.gitbook.io/typescript/ )
349
+ into TypeScript that was written to address
350
+ many common problems people run into when getting started.
You can’t perform that action at this time.
0 commit comments