Skip to content

Commit 33e227e

Browse files
committed
Full lazy load fragment with intersection
1 parent 375e328 commit 33e227e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@puzzle-js/client-lib",
33
"main": "dist/index.js",
4-
"version": "1.1.3",
4+
"version": "1.1.4",
55
"author": "<emre.kul@trendyol.com>",
66
"license": "MIT",
77
"repository": {

src/core.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class Core extends Module {
186186
}
187187

188188
private static onIntersection(changes: IntersectionObserverEntry[], observer: IntersectionObserver) {
189-
changes.some(change => {
189+
changes.forEach(change => {
190190
if (change.isIntersecting) {
191191
const target = change.target;
192192
const fragmentName = target.getAttribute('puzzle-fragment');
@@ -195,7 +195,6 @@ export class Core extends Module {
195195
this.asyncLoadFragment(fragment);
196196
observer.unobserve(target);
197197
}
198-
return fragment;
199198
}
200199
});
201200
}

0 commit comments

Comments
 (0)