Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maybe use tap ? #1

Open
pcarvsilva opened this issue Oct 26, 2022 · 0 comments
Open

Maybe use tap ? #1

pcarvsilva opened this issue Oct 26, 2022 · 0 comments

Comments

@pcarvsilva
Copy link

pcarvsilva commented Oct 26, 2022

why defining a defchain macro ?

def check_equals(value_to_check, value) do
 value_to_check
 |> tap(assert & &1 == value)
end

It removes the need to define a macro and makes a more readable code, also it makes it easier to extend for other types of behaviours

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant