Skip to content

convert targeting module to factory pattern#1606

Closed
jaiminpanchal27 wants to merge 1 commit intomasterfrom
targeting-factory
Closed

convert targeting module to factory pattern#1606
jaiminpanchal27 wants to merge 1 commit intomasterfrom
targeting-factory

Conversation

@jaiminpanchal27
Copy link
Collaborator

Type of change

  • Refactoring (no functional changes, no api changes)

Description of change

Convert targeting module to factory pattern.


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
Contributor

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

Comments