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

Update removeAdUnit #3527

Merged
merged 5 commits into from
Feb 21, 2019
Merged

Update removeAdUnit #3527

merged 5 commits into from
Feb 21, 2019

Conversation

deekshithraop
Copy link
Contributor

@deekshithraop deekshithraop commented Feb 6, 2019

Type of change

  • Feature

Description of change

pbjs.removeAdUnit()

updated removeAdUnit so that if it is invoked with no arguments it will remove all add units, and it will also accept an array argument of addUnitCodes and will only remove them.

@bretg
Copy link
Collaborator

bretg commented Feb 6, 2019

What's the use case here?

@mkendall07
Copy link
Member

modification of adUnits in single page applications. Eventually we should remove pbjs.adUnits as a globally accessible property,.

Copy link
Collaborator

@bretg bretg left a comment

Choose a reason for hiding this comment

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

Please remove package-lock.json from the PR

Copy link
Collaborator

@jsnellbaker jsnellbaker left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

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

I think we should make a single method that accepts an array of adUnit codes as an arg. If empty it would remove all adUnits

src/prebid.js Outdated
* Remove all adUnits from the $$PREBID_GLOBAL$$ configuration
* @alias module:pbjs.removeAllAdUnits
*/
$$PREBID_GLOBAL$$.removeAllAdUnits = function () {
Copy link
Member

Choose a reason for hiding this comment

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

hmmm should we make this removeAdUnits([adUnitCodeArray]) ? seems more flexible.

@deekshithraop deekshithraop changed the title Add removeAllAdUnits to the API Update removeAdUnit Feb 12, 2019
@deekshithraop
Copy link
Contributor Author

@mkendall07 made changes and updated description

Copy link
Member

@mkendall07 mkendall07 left a comment

Choose a reason for hiding this comment

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

LGTM

src/prebid.js Outdated
return;
}

var adUnitCodes;
Copy link
Member

Choose a reason for hiding this comment

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

prefer let.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@mkendall07
Copy link
Member

@bretg fyi we decided to not add an extra method here but instead reuse the existing one.

@jsnellbaker jsnellbaker merged commit 753f76a into master Feb 21, 2019
@cwbeck cwbeck mentioned this pull request Mar 1, 2019
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.

4 participants