Skip to content

Commit

Permalink
Update lib/elixir/pages/anti-patterns/design-anti-patterns.md
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim authored Sep 21, 2023
1 parent 4aaa1e4 commit a178d6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/elixir/pages/anti-patterns/design-anti-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ iex> DashSplitter.split("Lucas-Francisco-da-Matta-Vegi")

#### Refactoring

To remove this anti-pattern and make the library more adaptable and flexible, this type of configuration must be performed via parameters in function calls. The code shown below performs the refactoring of the `split/1` function by adding a new optional parameter of type *Keyword list*. With this new parameter, it is possible to modify the default behavior of the function at the time of its call, allowing multiple different ways of using `split/2` within the same application:
To remove this anti-pattern and make the library more adaptable and flexible, this type of configuration must be performed via parameters in function calls. The code shown below performs the refactoring of the `split/1` function by accepting [keyword lists](`Keyword`) as a new optional parameter. With this new parameter, it is possible to modify the default behavior of the function at the time of its call, allowing multiple different ways of using `split/2` within the same application:

```elixir
defmodule DashSplitter do
Expand Down

0 comments on commit a178d6c

Please sign in to comment.