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

convert targeting module to factory pattern #1606

Closed
wants to merge 1 commit into from

Conversation

jaiminpanchal27
Copy link
Collaborator

Type of change

  • Refactoring (no functional changes, no api changes)

Description of change

Convert targeting module to factory pattern.

var pbTargetingKeys = [];

targeting.resetPresetTargeting = function(adUnitCode) {
if (isGptPubadsDefined()) {
export function newTargeting() {
Copy link
Contributor

@dbemiller dbemiller Sep 22, 2017

Choose a reason for hiding this comment

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

As written, all these instances are hardcoded to depend on two pieces of mutable/global state: $$PREBID_GLOBAL$$ (through getBidLandscapeTargeting and getAlwaysUseBidTargeting) and the bidmanager (through getStandardKeys).

These two things should be arguments here, with the globals passed in in the export const targeting line.

That will make it possible (for someone else--unless you want to tackle it here) to clear the unit tests of the issues that @mkendall07 ran into in #1427, and bring the project one step closer to #1508.

@mkendall07
Copy link
Member

Declining as we need to re-write targeting.

@mkendall07 mkendall07 closed this Sep 25, 2017
@jaiminpanchal27 jaiminpanchal27 mentioned this pull request Oct 13, 2017
2 tasks
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