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

helpers should not modify passed options #179

Merged
merged 1 commit into from
Dec 13, 2016

Conversation

everplays
Copy link
Contributor

If you want to store options into a variable to avoid duplication,
unfortunately, the fa_icon changes the passed options. Therefore, the
second time that fa_icon is called with the same variable, some of
values are removed, e.g. class.

- icon_options = { class: 'foo' }
= fa_icon 'user', icon_options
= fa_icon 'tags', icon_options # this one will not have the foo class

If you want to store options into a variable to avoid duplication,
unfortunately, the fa_icon changes the passed options. Therefore, the
second time that fa_icon is called with the same variable, some of
values are removed, e.g. class.

```slim
- icon_options = { class: 'foo' }
= fa_icon 'user', icon_options
= fa_icon 'tags', icon_options # this one will not have the foo class
```
@Zouuup
Copy link

Zouuup commented Dec 13, 2016

+1

@rmm5t rmm5t merged commit c553d57 into bokmann:master Dec 13, 2016
@rmm5t
Copy link
Collaborator

rmm5t commented Dec 13, 2016

Perfect, clean, concise PR. Thanks!

@everplays everplays deleted the do-not-modify-passed-options branch December 13, 2016 15:29
@everplays
Copy link
Contributor Author

Thank you for quick merge.

@rmm5t
Copy link
Collaborator

rmm5t commented Dec 13, 2016

v4.7.0.1 was just released with this change. Thanks again! 🍻

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

Successfully merging this pull request may close these issues.

3 participants