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

Introduce sidebar content get/set functions #3773

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

Conversation

AntonKhorev
Copy link
Contributor

Part of c21b5ee.
OSM.getSidebarContent() is used in later commits of #3682 to store changeset lists.


$("#sidebar_content").html(content.not("link[type=\"application/atom+xml\"]"));

OSM.setSidebarContent([xhr.getResponseHeader("X-Page-Title"), xhr.responseText]);
Copy link
Member

Choose a reason for hiding this comment

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

What's the idea between packing these arguments into an array and then unpacking them inside the function rather than just passing two arguments?

Is it so you can pass the array returned by the get function into the set function in a later patch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The idea is for the get function to be able to receive as an argument whatever was returned by the set function.

Get() needs to return two things. They need to be packed into something before being returned. Currently it's easy to imagine how you can unpack them and pass as individual arguments to set(). What if I add more things? What if I decide that with more things it's better to return an object from get()? I don't want to unpack such objects for set() arguments.

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.

None yet

2 participants