Skip to content

Commit

Permalink
Add example to README
Browse files Browse the repository at this point in the history
  • Loading branch information
danielberkompas committed Oct 31, 2016
1 parent 24e2e3a commit d831a2e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ def full_name(d%{first_name, last_name}) do
end
```

It also works in case statements, like this:

```elixir
case post(url, data) do
{:ok, d%{body}} -> # instead of {:ok, %{body: body}}
# use body variable
_other ->
# ...
end
```

See the [Hex Documentation](https://hexdocs.pm/destructure) for more details.

## Installation
Expand Down

0 comments on commit d831a2e

Please sign in to comment.