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

Style rule 14. #2

Closed
bjornj12 opened this issue Dec 16, 2020 · 2 comments
Closed

Style rule 14. #2

bjornj12 opened this issue Dec 16, 2020 · 2 comments

Comments

@bjornj12
Copy link
Contributor

14. ALWAYS use Js.Array2 and Js.String2. NEVER use Js.Array and Js.String. This is required to keep the => piping consistent.

What are you using JS.array and Js.String for so much that it requires this rule?
And when you say the => piping consistent, can you give an example?

Would it make sense to just create an extention file of Js to avoid this?

include Js;

module Array = Array2;
module String = String2; 

Something in that direction?

nice Style guide! 💯

@aleks-tpom6oh
Copy link
Contributor

Hi Bjorn, thanks for your interest!

We are rarely using Js.String and that's the problem, it's hard to always keep in mind the thing that's rarely used

For example it's very easy to make an error like this, writing
property.type_->Js.String.replace("string", "str")
instead of
property.type_->Js.String2.replace("string", "str")
🤷‍♂️

I think there is a typo in the quote you mention, it should be the -> piping consistent

And your suggested setup looks very nice, thanks again!

@aleks-tpom6oh
Copy link
Contributor

This issue is now referenced in the guide as a way to handle the 14 🎉

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

2 participants