Skip to content

Commit f32499d

Browse files
authored
Update index.md
1 parent 7a4c505 commit f32499d

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

docs/index.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,29 @@ class Person extends Model {
4242
}
4343
```
4444

45-
**NB**: *Once your models are defined, you must call `Config.setup()`:
45+
**NOTE**: *Once your models are defined, you must call `Config.setup()`:
4646

4747
```js
4848
import { Config } from 'jsorm';
4949
Config.setup();
5050
```
5151

52+
### ES6/Typescript Classes
53+
54+
ES6 and TypeScript classes do not have an `inherited` hook. Because this hook provides critical functionality, you have three options:
55+
56+
* Edit your `.tsconfig`:
57+
* Set `target` to `es5`.
58+
* Add `noEmitHelpers: "true"`
59+
60+
* Call the inherited hook manually after each class definition:
61+
```ts
62+
class Author extends Person { ... }
63+
Person.inherited(Author);
64+
```
65+
66+
* Use the `let Person = Model.extend({ ... })` pattern shown above instead of native classes.
67+
5268
## Basic Usage
5369

5470
### Querying

0 commit comments

Comments
 (0)