From 407fd9636afe9bf68acdc7585abb35e613a99571 Mon Sep 17 00:00:00 2001 From: Joel Regus Date: Mon, 2 May 2016 17:31:30 -0400 Subject: [PATCH] =?UTF-8?q?Fix=20issue=20where=20observeIntersection=20was?= =?UTF-8?q?=20not=20returning=20the=20unlisten=20fu=E2=80=A6=20(#3060)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 3p/integration.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/3p/integration.js b/3p/integration.js index 4daf7c0421c5..6ddd8e821bf1 100644 --- a/3p/integration.js +++ b/3p/integration.js @@ -228,11 +228,12 @@ window.draw3p = function(opt_configCallback, opt_allowed3pTypes, // This only actually works for ads. const initialIntersection = window.context.initialIntersection; window.context.observeIntersection = cb => { - observeIntersection(cb); + const unlisten = observeIntersection(cb); // Call the callback with the value that was transmitted when the // iframe was drawn. Called in nextTick, so that callers don't // have to specially handle the sync case. nextTick(window, () => cb([initialIntersection])); + return unlisten; }; window.context.onResizeSuccess = onResizeSuccess; window.context.onResizeDenied = onResizeDenied;