Skip to content

Commit

Permalink
fix(composables): use a trust parameter to conditionally run composables
Browse files Browse the repository at this point in the history
  • Loading branch information
freddy38510 committed Jul 18, 2022
1 parent 9410ff3 commit 77071ca
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/composables/useHydrateOnInteraction.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { getCurrentInstance, onMounted, unref } from 'vue';
import getRootElements from '../utils/get-root-elements';

export default function useHydrateOnInteraction(
{ hydrate, onCleanup },
{ willPerformHydration, hydrate, onCleanup },
events = ['focus']
) {
if (!hydrate || typeof hydrate !== 'function') {
if (!willPerformHydration) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/composables/useHydrateWhenIdle.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { getCurrentInstance } from 'vue';

export default function useHydrateWhenIdle(
{ hydrate, onCleanup },
{ willPerformHydration, hydrate, onCleanup },
timeout = 2000
) {
if (!hydrate || typeof hydrate !== 'function') {
if (!willPerformHydration) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/composables/useHydrateWhenTriggered.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { watch, isRef, getCurrentInstance } from 'vue';

export default function useHydrateWhenTriggered(
{ hydrate, onCleanup },
{ willPerformHydration, hydrate, onCleanup },
trigger
) {
if (!hydrate || typeof hydrate !== 'function') {
if (!willPerformHydration) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions src/composables/useHydrateWhenVisible.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { getCurrentInstance, onMounted } from 'vue';
import { createHydrationObserver, getRootElements } from '../utils';

export default function useHydrateWhenVisible(
{ hydrate, onCleanup },
{ willPerformHydration, hydrate, onCleanup },
observerOptions
) {
if (!hydrate || typeof hydrate !== 'function') {
if (!willPerformHydration) {
return;
}

Expand Down

0 comments on commit 77071ca

Please sign in to comment.