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

Encapsulate query strings #3687

Closed
wants to merge 11 commits into from
Closed

Encapsulate query strings #3687

wants to merge 11 commits into from

Conversation

rauchy
Copy link
Contributor

@rauchy rauchy commented Apr 8, 2019

What type of PR is this? (check all applicable)

  • Refactor
  • Feature

Description

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings (if there are UI changes)

}

return qs.toString(Object.assign(...this.get().map(p => p.toUrlParams())));
return qs.toString(this.getValues());
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's better to use param.toUrlParams() instead of mapping name => value directly - it provides some layer of abstraction for a case when param will need some different serialization logic in future.

Copy link
Contributor Author

@rauchy rauchy Apr 10, 2019

Choose a reason for hiding this comment

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

What I'm trying to achieve with this refactoring is moving out the serialization logic from Parameter/Parameters and into the query string module. The approach here is that a query string is itself the serialization "view", thus the logic resides there and the model simply reveals its data.

@rauchy rauchy requested a review from arikfr April 14, 2019 11:24
@rauchy rauchy marked this pull request as ready for review April 14, 2019 11:25
@arikfr
Copy link
Member

arikfr commented Jun 12, 2019

This is no longer needed, right?

@rauchy
Copy link
Contributor Author

rauchy commented Jul 14, 2019

@arikfr it was never needed, but I guess at this point it'll be better to revisit this at Datetime.max.

@rauchy rauchy closed this Jul 14, 2019
@rauchy rauchy deleted the encapsulate-query-strings branch July 21, 2019 21:10
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