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

Replaced var keyword with const in RotateHandle.js #1089

Merged
merged 1 commit into from
Oct 11, 2022
Merged

Replaced var keyword with const in RotateHandle.js #1089

merged 1 commit into from
Oct 11, 2022

Conversation

Tammy-Ajoko
Copy link
Contributor

Fixes #1086

Make sure these boxes are checked before your pull request (PR) is ready to be reviewed and merged. Thanks!

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with grunt test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updates
  • [@TildaDares ] @mention the original creator of the issue in a comment below for help or for a review

We're happy to help you get this ready -- don't be afraid to ask for help, and don't be discouraged if your tests fail at first!

If tests do fail, click on the red X to learn why by reading the logs.

Please be sure you've reviewed our contribution guidelines at https://publiclab.org/contributing-to-public-lab-software

Thanks!

@welcome
Copy link

welcome bot commented Oct 10, 2022

Thanks for opening this pull request! Dangerbot will test out your code and reply in a bit with some pointers and requests.
There may be some errors, but don't worry! We're here to help! 👍🎉😄


One thing that can help to get started is to make sure you've included a link back to the original issue you're solving, in the format fixes #0000 (for example). And to make sure the PR title describes what you're trying to do! (often it can be the same as the issue title) Thanks! 🙌


Then, you can say hello in our chatroom & share a link to this PR to get a review! 👋 ✅

@gitpod-io
Copy link

gitpod-io bot commented Oct 10, 2022

@jywarren jywarren changed the title Replaced var keyword with const Replaced var keyword with const in RotateHandle.js Oct 11, 2022
@jywarren jywarren merged commit 103443b into publiclab:main Oct 11, 2022
@welcome
Copy link

welcome bot commented Oct 11, 2022

Congrats on merging your first pull request! 🙌🎉⚡️
Your code will likely be published to https://mapknitter.org in the next few days.
Now that you've completed this, you can help someone else take their first step!
Reach out to someone else working on theirs on Public Lab's code welcome page (where you'll now be featured as a recent contributor!). Thanks!

Help others take their first step

Now that you've merged your first pull request, you're the perfect person to help someone else out with this challenging first step. 🙌

https://code.publiclab.org

Try looking at this list of `first-timers-only` issues, and see if someone else is waiting for feedback, or even stuck! 😕

People often get stuck at the same steps, so you might be able to help someone get unstuck, or help lead them to some documentation that'd help. Reach out and be encouraging and friendly! 😄 🎉

Read about how to help support another newcomer here, or find other ways to offer mutual support here.

@jywarren
Copy link
Member

Great work, thank you so much!!

jywarren added a commit that referenced this pull request Oct 11, 2022
@jywarren
Copy link
Member

@TildaDares i think i may have missed something here and will address in #1097, my apologies!

jywarren added a commit that referenced this pull request Oct 11, 2022
* Revert "Replaced `var` keyword with `const` (#1089)"

This reverts commit 103443b.

* let/const instead of var
@jywarren
Copy link
Member

Actually I think i need help answering this. I second guessed my approving this PR with only const, and modified it to use some let. But since const scope is only within the block and we finish using all these values within the scope of _onHandleDrag(), I think maybe @Tammy-Ajoko was correct and all of these can be const. @TildaDares do you think that's correct? If so, @Tammy-Ajoko my apologies for changing part of this. If you'd like, and @TildaDares agrees, you could change them back to const in a new PR and let us know in the chatroom.

I guess I'm also still adjusting to ES6!! 😅

@Tammy-Ajoko
Copy link
Contributor Author

Great work, thank you so much!!

Thank you very much, and thank you for the changes as well 😊

@TildaDares
Copy link
Member

You're right @jywarren. Also if the variable declared with const is changed in the function that it was passed to, it would not raise an error because the variable is passed by value and not reference.

@ChiomaNwosisi ChiomaNwosisi mentioned this pull request Oct 11, 2022
5 tasks
@Tammy-Ajoko
Copy link
Contributor Author

You're right @jywarren. Also if the variable declared with const is changed in the function that it was passed to, it would not raise an error because the variable is passed by value and not reference.

@TildaDares @jywarren Sorry does this mean I should make another PR and change it to const or not.

@jywarren
Copy link
Member

Hi @Tammy-Ajoko yes you can do that, if you can please add a link to this PR so that others can see our reasoning, that would be great. Thank you and sorry for the confusion!

Tammy-Ajoko added a commit to Tammy-Ajoko/Leaflet.DistortableImage that referenced this pull request Oct 14, 2022
This is an update for my last pull request
publiclab#1089
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.

Replace var keyword with let/const
3 participants