Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make proposals queries reactive by accepting MaybeRefOrGetter #1190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sekhmet
Copy link
Member

@Sekhmet Sekhmet commented Feb 14, 2025

Summary

Previously our proposals queries were not reactive as they should, because we only accepted rawValues. However we should make those values refs, so queries are properly reactive.

We do this by following composables recommendation and making all values accept MaybeRefOrGetter: https://vuejs.org/guide/reusability/composables.html#input-arguments

Lack of this reactivity caused bunch of issues as we migrated to use vue-query for Spaces. This might not have any effect in current state (so it's more of a refactor now), but is needed for resubmit of that PR.

How to test

  1. Go to proposals page, space overview, proposal page, search proposals pages.
  2. Everything works as expected.

Previously our proposals queries were not reactive as they should, because
we only accepted rawValues. However we should make those values refs,
so queries are properly reactive.

We do this by following composables recommendation and making all values accept
MaybeRefOrGetter: https://vuejs.org/guide/reusability/composables.html#input-arguments

Lack of this reactivity caused bunch of issues as we migrated to use vue-query
for Spaces. This might not have any effect in current state (so it's more of a refactor
now), but is needed for resubmit of that PR.
@@ -4,43 +4,49 @@ import {
useQuery,
useQueryClient
} from '@tanstack/vue-query';
import { MaybeRef } from 'vue';
import { MaybeRefOrGetter } from 'vue';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Vue 3.3+ accepting getters is recommended way.

Copy link
Member

@bonustrack bonustrack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants