fix function signatures for osmAuth - #147
Closed
k-yle wants to merge 1 commit into
Closed
Conversation
Member
|
We should probably just rewrite this thing to be an actual ES6 class. |
Member
Author
Would you accept a PR that does this? the diff would be massive (adding maybe the best short-term option is just to update the README, to suggest that people use |
Member
|
Yeah for now let's just update the docs to encourage |
Member
Author
|
cool, then I'll close this and we can follow up on the docs in #148 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow up from openstreetmap/iD#11661 (comment)
This reverts #125, since that PR broke IDE-autocomplete and type-safety for anyone who uses
x = osmAuth()rather thanx = new osmAuth().Declaring
osmAuthas an ES6 class is wrong, since it's just a function. Therefore it's valid to instantiate the class without thenewoperator. The example in the README also does not usenew.This is not an exact revert of #125, instead it settles on a compromise that should work for everyone. Therefore, this is not a breaking change.
Tested by creating a new file in the repo called
test.tswith the following content:If the file compiles with no errors, that proves that this PR works for both cases.