Skip to content

[feature request] Add option to clear the data before or after the firebase request is complete #213

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

Closed
wujekbogdan opened this issue Sep 19, 2018 · 1 comment

Comments

@wujekbogdan
Copy link
Contributor

wujekbogdan commented Sep 19, 2018

Let's assume that I have bound a collection to this.posts and initialized the collection with an empty array. At the moment querying the data looks as follows:

  1. this.posts is an empty array on startup
  2. The data is queried from Firebase
  3. After the request is done this.posts is populated with the data
  4. I call this.$bind('posts', /* some query here */ )
  5. The data is queried from Firebase and this.posts array is set to []
  6. After the request is done this.posts populated with the data

At the 5th step, the collection is set to []. If the data is displayed on the template (which usually happens ;)), then view re-renders, so for a fraction of a second, the list of posts is empty.

It would be great if this behaviour was configurable - if we could set whether we want to clear the data before or after a firebase request is complete.

Is there any workaround? The only thing that comes to my mind is to use Vuex. But for small apps, Vuex is usually an unnecessary overkill.

@posva
Copy link
Member

posva commented Sep 19, 2018

Duplicate of #83

@posva posva closed this as completed Sep 19, 2018
@posva posva marked this as a duplicate of #83 Sep 19, 2018
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

No branches or pull requests

2 participants