@@ -19,7 +19,7 @@ import {withError} from './with-error';
1919 * export const DfpAd = createDfpAdComponent({
2020 * defaultNetworkID: "123456789",
2121 * config: CONFIG,
22- * targeting: function(state) {
22+ * targeting: function(state, ownProps ) {
2323 * const params = {};
2424 *
2525 * // if(storyIsSponsored) params['sponsor'] = storySponsor
@@ -36,16 +36,16 @@ import {withError} from './with-error';
3636 * @param {Object } params
3737 * @param {string } params.defaultNetworkID - Network Id of the Ad Provider
3838 * @param {Object } params.config - Configuration of the ads (see example)
39- * @param {function } params.targeting - Function which takes in the current state, and returns targetting parameters
39+ * @param {function } params.targeting - Function which takes in the current state, props from the parent component and returns targetting parameters
4040 * @param {boolean } params.collapseEmptyDivs (default true)
4141 * @param {boolean } params.lazyLoad (default true)
4242 * @param {boolean } params.singleRequest - Run Dfp in Single Request Mode (default false)
4343 * @category Ads
4444 * @returns {Component } A component that can
4545 */
4646export function createDfpAdComponent ( { defaultNetworkID, config, targeting, collapseEmptyDivs = true , lazyLoad = true , singleRequest = false } ) {
47- return connect ( ( state ) => ( {
48- targetingArguments : targeting ( state ) ,
47+ return connect ( ( state , ownProps ) => ( {
48+ targetingArguments : targeting ( state , ownProps ) ,
4949 defaultNetworkID : defaultNetworkID ,
5050 config : config ,
5151 collapseEmptyDivs : collapseEmptyDivs ,
0 commit comments