* @param {!Object} sandbox * @param {!Window} win
(sandbox, win)
| 15 | * @param {!Window} win |
| 16 | */ |
| 17 | constructor(sandbox, win) { |
| 18 | const observers = new Set(); |
| 19 | this.observers = observers; |
| 20 | |
| 21 | sandbox |
| 22 | .stub(win, 'IntersectionObserver') |
| 23 | .value(function (callback, options) { |
| 24 | const observer = new IntersectionObserverStub(callback, options, () => { |
| 25 | observers.delete(observer); |
| 26 | }); |
| 27 | observers.add(observer); |
| 28 | return observer; |
| 29 | }); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * @param {!Element} target |