Skip to content
Next Next commit
feat: allow for populates config to be generated from cb with snapsho…
…t arg
  • Loading branch information
javamonn committed May 14, 2017
commit 26990d8d9bdc941577cac28923334d9d19c1fccb
4 changes: 2 additions & 2 deletions src/actions/query.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { forEach, size } from 'lodash'
import { forEach, size, isFunction } from 'lodash'
import { actionTypes } from '../constants'
import { promisesForPopulate } from '../utils/populate'
import {
Expand Down Expand Up @@ -132,7 +132,7 @@ export const watchEvent = (firebase, dispatch, { type, path, populates, queryPar
// TODO: Allow setting of unpopulated data before starting population through config
// TODO: Set ordered for populate queries
// TODO: Allow config to toggle Combining into one SET action
promisesForPopulate(firebase, data, populates)
promisesForPopulate(firebase, data, isFunction(populates) ? populates(snapshot) : populates)
.then((results) => {
dispatch({
type: SET,
Expand Down