vuexfire

Vuexfire bindFirebaseRef with pagination infinite scroll

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-18 17:54:45
问题 Question : How can I add pagination (infinite scroll) to my binded Firestore VuexFire reference without re-querying previously retrieved (and binded) results? Background : I am currently using VuexFire firestore binding to fill a timeline for most upvoted posts, as an action, in my Vuex store like this: fillTimeLine: firebaseAction( ({ bindFirebaseRef }) => { bindFirebaseRef( 'timelineResults', db .collection('POSTS') .orderBy('combined_vote_score', 'desc') .limit(30) ) }) This will retrieve

Paginating firestore data when using vuex and appending new data to the state

巧了我就是萌 提交于 2020-07-10 10:27:09
问题 I implemented the following to display a paginated query (this was suggested by Tony O'Hagan in this post: How to get the last document from a VueFire query): bindUsers: firestoreAction(({ bindFirestoreRef }) => { return bindFirestoreRef('users', Firebase.firestore().collection('users').limit(8), { serialize }) }), bindMoreUsers: firestoreAction(context => { return context.bindFirestoreRef('users', Firebase.firestore().collection('users').startAfter(context.state.users[context.state.users

How to use Moment.js with Vuexfire

拈花ヽ惹草 提交于 2020-01-27 08:47:24
问题 I am building a Vue.js application that uses Vuexfire in a store.js file. My application enables a user to push user-inputted posts with timestamps into Firestore. I am configuring my Vuexfire action handler to commit to mutation the firebase payload arranged in order by timestamp, like so: import Vue from "vue"; import Vuex from "vuex"; import firebase from "firebase"; import { vuexfireMutations, firestoreAction } from 'vuexfire' import { db } from "@/main"; import moment from 'moment' Vue