Skip to content

Commit

Permalink
Extend domain logic section in LAYERS with usage example
Browse files Browse the repository at this point in the history
  • Loading branch information
KLarpen authored and tshemsedinov committed Dec 13, 2023
1 parent 614dea2 commit 0a5a393
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions content/en/LAYERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,15 @@ There is a special place for domain logic and application state: `application/do
});
```

The methods and public properties of the module will be available from another application layers through the `domain.chat` namespace. For example it made possible a thin API endpoint `application/api/chat/send.js` that will deliver a message from one chat room participant to all others without handling a state by itself:

```js
(async ({ room, message }) => {
domain.chat.send(room, message);
return true;
});
```

## Libraries

Auxiliary code that is not related to subject domain, but we don't want to create or import separate dependencies for it, can be placed in: `application/lib`. For example:
Expand Down

0 comments on commit 0a5a393

Please sign in to comment.