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

refactor(carto): Refactor fetchMap() for deck.gl v9.1 #9232

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

donmccurdy
Copy link
Collaborator

A followup to #9230, this PR does some internal refactoring of fetchMap() to reduce the (repeated) use of optional parameters with defaults imported from SOURCE_DEFAULTS, and tries to decouple the file somewhat from the baseSource() implementation. User-facing API is unchanged.

It probably also makes sense to move this function into @carto/api-client at some point, but I don't think we're ready to tackle that for v9.1.

Opening as a draft for discussion, in case we prefer to structure this differently.

@coveralls
Copy link

Coverage Status

coverage: 91.648% (+0.03%) from 91.616%
when pulling 99c229b on donmccurdy/carto-fetchmap-v9.1
into 920cf98 on master.

clientId = SOURCE_DEFAULTS.clientId,
headers = {},
clientId,
headers,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a change of behavior?

@@ -298,23 +281,27 @@ export async function fetchMap({
const baseUrl = buildPublicMapUrl({apiBaseUrl, cartoMapId});
const errorContext: APIErrorContext = {requestType: 'Public map', mapId: cartoMapId};
const map = await requestWithParameters({baseUrl, headers, errorContext, maxLengthURL});
const context: _FetchMapContext = {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const context: _FetchMapContext = {
const context: FetchMapContext = {

Why the underscore?

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