Skip to content

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

@wujekbogdan

Description

@wujekbogdan

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions