code: function(myFilter, count, timeOut) {
      timeOut = timeOut ? timeOut : 30000;
      var promise = new Promise(function(resolve, reject) {
        count = (typeof count !== "undefined") ? count : 1;
        var results = [];
        var toClear = setTimeout(function() {
          myFilter.stopWatching();
          reject(new Error("Timed out"));
        }, timeOut);
        myFilter.watch(function(error, result) {
          if (error) {
            clearTimeout(toClear);
            reject(error);
          } else {
            count--;
            results.push(result);
          }
          if (count <= 0) {
            clearTimeout(toClear);
            myFilter.stopWatching();
            resolve(results);
          }
        });
      });
      if (count == 0) {
        promise = promise
          .then(function(events) {
            throw "Expected to have no event";
          })
          .catch(function(error) {
            if (error.message != "Timed out") {
              throw error;
            }
          });
      }
      return promise;
    }
docs: From https://gist.github.com/xavierlepretre/afab5a6ca65e0c52eaf902b50b807401