Skip to content

Unbind useCollection on logout #1446

Closed Answered by posva
mrleblanc101 asked this question in Questions and Help
Discussion options

You must be logged in to vote

You need to ensure the correct values are being passed:

const entries = useCollection<Entry>(
    computed(() =>
		user.value
        ? query(
            collection(db, 'entries').withConverter(dateConverter),
            where('user', '==', user.value.uid),
            where('date', '>=', weekStart.value),
            where('date', '<=', weekEnd.value),
        )
		: null,
    ),
    {
        ssrKey: 'entries',
    },
);

VueFire allows passing null to these functions for this purpose. There is even an example in docs

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@posva
Comment options

@mrleblanc101
Comment options

@mrleblanc101
Comment options

Answer selected by mrleblanc101
Comment options

You must be logged in to vote
1 reply
@mrleblanc101
Comment options

Comment options

You must be logged in to vote
1 reply
@Watster69
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #1445 on October 11, 2023 06:01.