Using When Clauses In A With Construct
Last updated
Was this helpful?
Last updated
Was this helpful?
Because Elixir's with
construct supports the full power of the language's pattern matching, we can use when
clauses to further narrow down our matches.
For instance, if we want to match against the response to an API request, but only for response status codes in the 2xx range, we can do something like the following:
See the for more details.