I'm reading through some code elixir code on github and I see |>
being used often. It does not appear in the list of operation on the documentation site. What does it mean?
i.e.
expires_at: std["expires_in"] |> expires_at,
I'm reading through some code elixir code on github and I see |>
being used often. It does not appear in the list of operation on the documentation site. What does it mean?
i.e.
expires_at: std["expires_in"] |> expires_at,
it gives you ability to avoid bad code like this:
same code using pipeline operator:
look at Payment.make_payments function, there is second bool parameter, if that was first parameter like this:
it would not worked anymore.
when developing elixir application keep in mind that important parameters should be at first place, in future it will give you ability to use pipeline operator.
I hate this question when writing non elixir code: what should i name this variable? I waste lots of time on answer.
This is the pipe operator. From the linked docs:
In addition to Stefan's excellent response, you may want to read the section called "Pipeline Operator" of this blog posting for a better understanding of the use case that the pipeline operator is intended to address in Elixir. The important idea is this: