mirror of
https://github.com/labs42io/clean-code-typescript.git
synced 2024-11-23 05:34:04 +00:00
fixed usage of array type (#24)
This commit is contained in:
parent
15b1b550a4
commit
4592b199e6
|
@ -317,7 +317,7 @@ This is by far the most important rule in software engineering. When functions d
|
|||
**Bad:**
|
||||
|
||||
```ts
|
||||
function emailClients(clients: Client) {
|
||||
function emailClients(clients: Client[]) {
|
||||
clients.forEach((client) => {
|
||||
const clientRecord = database.lookup(client);
|
||||
if (clientRecord.isActive()) {
|
||||
|
@ -330,7 +330,7 @@ function emailClients(clients: Client) {
|
|||
**Good:**
|
||||
|
||||
```ts
|
||||
function emailClients(clients: Client) {
|
||||
function emailClients(clients: Client[]) {
|
||||
clients.filter(isActiveClient).forEach(email);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue