Updated README.md to improve readability (#53)

At Functions should do one thing, the function emailClients is only emailing activeClients, thus the suggestion to make its name explicit for reliability purposes.
This commit is contained in:
Luís Guilherme Ferreira 2022-04-17 16:02:19 +01:00 committed by GitHub
parent 14e3a9d711
commit 66a0d8cd0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -372,7 +372,7 @@ This is by far the most important rule in software engineering. When functions d
**Bad:**
```ts
function emailClients(clients: Client[]) {
function emailActiveClients(clients: Client[]) {
clients.forEach((client) => {
const clientRecord = database.lookup(client);
if (clientRecord.isActive()) {
@ -385,7 +385,7 @@ function emailClients(clients: Client[]) {
**Good:**
```ts
function emailClients(clients: Client[]) {
function emailActiveClients(clients: Client[]) {
clients.filter(isActiveClient).forEach(email);
}