title: How to call yield in firebase read API
body: <p>I have a redux saga API, where by I am connecting to firebase and reading records of data.</p>
  
  <pre class="lang-js prettyprint-override"><code>var roomRef = firebase.database().ref('/Users/' + userid + '/rooms')
    var rooms = []
    roomRef.once('value', function (snap) {
      var roomkeys = snap.val()
      for (var roomkey in roomkeys) {
        firebase.database().ref('/Rooms/' + roomkey).once('value', function (item) {
          rooms.push(item.val())
        })
      }
      console.log(rooms)
     --&gt; put({type: 'LOAD_ROOMS', payload: { rooms: rooms}})
    })
  </code></pre>
  
  <p>Since my put is inside a callback function I cannot use the yield keyword. How do I dispatch an event to change the state of my reducer with the new values 'rooms'</p>