Assigner is a simple macro that allows you to assign values to variables in a pipeline.
use Assigner
2 + 2
|> assign(:a)
assert a == 4
# or
4 * 4
|> assign(b) # no need to initialize a variable
assert b == 16If available in Hex, the package can be installed
by adding assigner to your list of dependencies in mix.exs:
def deps do
[
{:assigner, "~> 0.1.0"}
]
endDocumentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/assigner.