The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Introduction to apiCheck.js

Introduction to apiCheck.js

3:52
Because JavaScript is a typeless language, validating your api is a terrific way to help avoid bugs and instruct users of your API without requiring them to check documentation. See how api-check can help you do this. If you're familiar with ReactJS propTypes, this will be familiar to you.
Watch this lesson now
Avatar
egghead.io

Because JavaScript is a typeless language, validating your api is a terrific way to help avoid bugs and instruct users of your API without requiring them to check documentation. See how api-check can help you do this. If you're familiar with ReactJS propTypes, this will be familiar to you.

Avatar
Martin

Typescript will do quite the same without the overhead of needing library dependencies and extra code in your output :)

In reply to egghead.io
Avatar
Kent C.

Very true, but there are two problems with this:
1) As a library author, I can't force my users to use TypeScript, so type definitions don't help those who don't use TypeScript and I wind up getting a bunch of issues from people who are using the API wrong
2) TypeScript is not capable of type checking the API of an angular directive. api-check makes this possible and is used by angular-formly and angular-scope-types to do this.

The main thing is that TypeScript doesn't do runtime type checking (development only of course, api-check can be disabled for production). This is fine, and I don't think I'd have it any other way. But api-check is really handy for APIs that need runtime checking (like an angular directive or a React component). React doesn't need something like this because it was actually the inspiration for the library in the first place (propTypes).

In reply to Martin
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?