function setWatcher(firebase, dispatch, event, path, queryId) {
  const id =
    queryId || getQueryIdFromPath(path, event) || getWatchPath(event, path)

  if (firebase._.watchers[id]) {
    firebase._.watchers[id]++
  } else {
    firebase._.watchers[id] = 1
  }

  dispatch({ type: actionTypes.SET_LISTENER, path, payload: { id } })

  return firebase._.watchers[id]
}
@private
@param {object} firebase - Internal firebase object
@param {Function} dispatch - Redux dispatch function
@param {string} event - Type of event to watch for
@param {string} path - Path to watch with watcher
@param {string} queryId - Id of query
@returns {number} watcherCount - count