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

get config values from global object related to issue #69 #253

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

get config values from global object related to issue #69 #253

wants to merge 1 commit into from

Conversation

marifehe
Copy link

This is needed for AdapterJS to be able to pick values that have been set before it is required or imported, otherwise the var AdapterJS = ... itself is already overwriting whatever was in the global variable.
It is interpreted as:

var AdaptjerJS;
AdaptjerJS = AdapterJS || {};

Accessing through window solves the issue.
Does it make sense to you?

@johache
Copy link
Contributor

johache commented Jan 19, 2017

LGTM.
@letchoo any objections ?

@marifehe marifehe changed the title get config values from global object #69 get config values from global object related to issue #69 Jan 19, 2017
@marifehe
Copy link
Author

marifehe commented Jan 19, 2017

Actually, I think the way I did it, the real AdapterJS would be available in global scope. What do you think about getting only a copy of the config values with
var AdapterJS = (window && window.AdapterJS && JSON.parse(JSON.stringify(window.AdapterJS))) || {}; ?

This way the real AdapterJS truly remains local and won't be available in the global scope.

@marifehe
Copy link
Author

Will it be possible to merge this? :)

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.

2 participants