AndersDJohnson / firedux

:fire: :hatching_chick: Firebase + Redux for ReactJS
https://andersdjohnson.github.io/firedux/
MIT License
149 stars 12 forks source link

get data once #79

Closed devgripes closed 7 years ago

devgripes commented 7 years ago

so i have array of keys for answers:

const arryKeys = ['answer1', 'answer2']

my data structure looks like this:

questions {
  name: 'test',
  answers: {
    answer1: true,
    answer2: true
  }
}

answers {
  answer1 {
    name: 'Yes'
  }
  answer2 {
    name: 'No'
  }
}

i tried to do this to get the actual answers value on answers

arryKeys.map((aK) => {
  firedux.get(`users/${aK}`)
})

i'm not sure what's the best way to do it, hope someone can help me, thanks

AndersDJohnson commented 7 years ago

@kuronaru It's hard to say what your specific issue is without more details, but did you notice you have users instead of answers? Try this:

arryKeys.map((aK) => {
  firedux.get(`answers/${aK}`)
})
devgripes commented 7 years ago

sorry for the confusion, i was able to figure it out now. thanks :)