docs: function debounce (fn) {
    let calling = null
    let latestArgs = null
    return (...args) => {
      latestArgs = args
      if (!calling) {
        calling = Promise.resolve().then(() => {
          calling = null
          // At this point `args` may be different from the most
          // recent state, if multiple calls happened since this task
          // was queued. So we use the `latestArgs`, which definitely
          // is the most recent call.
          return fn(...latestArgs)
        })
      }
      return calling
    }
  }