November 2019
Beginner
804 pages
20h 1m
English
We'll create a common package for this class. This will represent a layer of code that is shared between different parts of our code base:
Inside the src/common/errors folder, do the following: Create a file called unreachable-case-error.ts. Here's the code:
export class UnreachableCaseError extends Error {
constructor(val: never) {
super(`Unreachable case: ${val}`);
}
}
Next, do the following:
With this done, we'll be ...
Read now
Unlock full access