code: function cacheQueryResult (cached) {
      // decode result if not null
      if (cached !== null) {
          try {
              // decode JSON
              this.cached = JSON.parse(cached)
              // add cached view flag
              this.cached._cachedView = true
          }
          catch (err) {
              // ignore errors
          }
      }
      // return cached result or load
      return defined(this.cached) ? this.cached : this.loadUncached()
  }
docs: @function cacheQuery
  
  @param {array} cached
  
  @returns {Promise}