-
-
Notifications
You must be signed in to change notification settings - Fork 322
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
Why executes a computed function twice? #35
Comments
That behaviour is intended. The computed property reacts first to the empty array then firebases fetches data and updates the array again. Nothing to worry about 😉 |
This is a solution I implemented for what I think to be a similar challenge. ... may or may not be helpful Cheers --
methods: {
|
I know this is a closed issue but I faced the same issue in my app. Here is my solution. If I take the initial example, I was watching the |
I have a component that collects data from Firebase. The data contains subscriptions (236) of people that subscribe to courses (21) with a specific date.
In a computed property (of the component) I get the unique dates and store them in an array. This array is the base for the v-for in the component. So a list of unique dates is listed (in a panel-group), and every panel shows the subscribers for that particular date.
I console log this computed property (named courseDates) and see that this function is executed twice. Btw, the first time it executes no date is there (yet). In the second cycle it has the data.
Am I doing something wrong here, that it executes twice to collect the data from firebase? Does this sound familiar? Is this a bug? Hope to here from you...
Below the code of the component...
If needed, I can share code via Github repo.
The text was updated successfully, but these errors were encountered: