refactors Discourse.debouncePromise