Skip to content

Commit 2dbc334

Browse files
committed
Merge branch 'dev'
2 parents 089c388 + 868109e commit 2dbc334

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,13 @@ Breaking changes:
237237

238238
## Articles
239239

240+
- [Partial Hydration Concepts: Lazy and Active](https://markus.oberlehner.net/blog/partial-hydration-concepts-lazy-and-active/)
240241
- [abomination: a Concept for a Static HTML / Dynamic JavaScript Hybrid Application](https://markus.oberlehner.net/blog/abomination-a-concept-for-a-static-html-dynamic-javascript-hybrid-application/)
241242
- [How to Drastically Reduce Estimated Input Latency and Time to Interactive of SSR Vue.js Applications](https://markus.oberlehner.net/blog/how-to-drastically-reduce-estimated-input-latency-and-time-to-interactive-of-ssr-vue-applications/)
242243

243244
## Credits
244245

245-
The code of the current implementation of this package is based on a [similar package created by **Rahul Kadyan**](https://github.com/znck/lazy-hydration). Thanks to his code I'm finally able to build a clean solution for what I dreamed of when I created the [abomination](https://markus.oberlehner.net/blog/abomination-a-concept-for-a-static-html-dynamic-javascript-hybrid-application/).
246+
The code of the v1 version of this package was based on a [similar package created by **Rahul Kadyan**](https://github.com/znck/lazy-hydration).
246247

247248
## Testing
248249

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-lazy-hydration",
3-
"version": "2.0.0-beta.0",
3+
"version": "2.0.0-beta.1",
44
"description": "Lazy hydration of server-side rendered Vue.js components",
55
"keywords": [
66
"hydration",

src/utils/hydration-blocker.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,18 @@ export function makeHydrationBlocker(component, options) {
5959
this.hydrationPromise.then(cleanup);
6060
}
6161

62-
if (this.interactionEvents.length) {
62+
if (this.interactionEvents && this.interactionEvents.length) {
6363
const eventListenerOptions = {
6464
capture: true,
6565
once: true,
6666
passive: true,
6767
};
6868

6969
this.interactionEvents.forEach((eventName) => {
70-
const eventListenerParams = [eventName, this.hydrate, eventListenerOptions];
71-
this.$el.addEventListener.apply(null, eventListenerParams);
72-
const cleanup = () => this.$el.removeEventListener.apply(null, eventListenerParams);
70+
this.$el.addEventListener(eventName, this.hydrate, eventListenerOptions);
71+
const cleanup = () => {
72+
this.$el.removeEventListener(eventName, this.hydrate, eventListenerOptions);
73+
};
7374
this.cleanupHandlers.push(cleanup);
7475
});
7576
}

0 commit comments

Comments
 (0)