Skip to content

Commit

Permalink
docs: add statement about import and actor sequence (#4688)
Browse files Browse the repository at this point in the history
Add a statement about import and actor sequence based on question related to this forum post: https://forum.dfinity.org/t/misplaced-await-and-misplaced-async/34479

Co-authored-by: Jessie Mongeon <[email protected]>
Co-authored-by: Luc Blaeser <[email protected]>
  • Loading branch information
3 people authored Dec 6, 2024
1 parent 952f3d1 commit fcd7b81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/md/writing-motoko/actors-async.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ In Motoko, actors have dedicated syntax and types:

- Waiting on `f` to be completed is expressed using `await f` to obtain a value of type `T`. To avoid introducing shared state through messaging, for example, by sending an object or mutable array, the data that can be transmitted through shared functions is restricted to immutable, shared types.

- All state should be encapsulated within the actor or actor class. The main actor file should begin with imports, followed by the actor or actor class definition.

## Defining an actor

Consider the following actor declaration:
Expand Down

0 comments on commit fcd7b81

Please sign in to comment.