Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
benStre committed Mar 20, 2024
1 parent 4d5e947 commit bbd01d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/manual/12 Classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ obj.sum // 26
## Constructors

The normal JavaScript class constructor gets called every time an instance of a sync class is created.
When an existing instance of a sync class is shared with another endpoint, the constructor is
When an existing instance of a struct class is shared with another endpoint, the constructor is
called again locally on the endpoint, which is not intended but can't be prevented.

For this reason, struct classes cannot use normal constructors.
Expand All @@ -84,7 +84,7 @@ const MyObject = struct(
}
)

const obj = new MyObject(42) // "constructed a new MyObject" is logged
const obj = new MyObject() // "constructed a new MyObject" is logged
```

When the `obj` pointer is now accessed on a remote endpoint, the `construct` method
Expand Down

0 comments on commit bbd01d6

Please sign in to comment.