-
Notifications
You must be signed in to change notification settings - Fork 16
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
Refactor useViewportFeatures #238
Conversation
Pull Request Test Coverage Report for Build 1573320190
💛 - Coveralls |
setSourceViewportFeaturesReady(false); | ||
executeTask(sourceId, Methods.LOAD_GEOJSON_FEATURES, { geojson }) | ||
.then(() => setGeoJsonLoaded(true)) | ||
.catch(throwError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. I don't mind a lot about then.catch, but what about the previous catch errors we had?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same answer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see the custom throw. Agree that having it with then is more compact, thus probably more readable in this case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @VictorVelarde, about using await
instead of then
because it goes more in line with our style guides but it is a suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just small comments, but LGTM. I think it's a nice idea to have them separated.
My only concern is the error management we had and now it's gone.
Let's have tomorrow another quick CR and talk and then we can merge.
@VictorVelarde error management isn't gone, still there. It was just generalised for having the same one in both hooks. |
We will check with @padawannn tomorrow before the merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGFM, some suggestions
setSourceViewportFeaturesReady(false); | ||
executeTask(sourceId, Methods.LOAD_GEOJSON_FEATURES, { geojson }) | ||
.then(() => setGeoJsonLoaded(true)) | ||
.catch(throwError); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @VictorVelarde, about using await
instead of then
because it goes more in line with our style guides but it is a suggestion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 nice job!
No description provided.