1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-25 05:23:13 +03:00

Merge branch 'develop' into travis/upgrade-notifications

This commit is contained in:
Travis Ralston
2019-11-26 10:29:40 -07:00
committed by GitHub
22 changed files with 309 additions and 243 deletions

View File

@@ -718,3 +718,16 @@ module.exports.sleep = (ms, value) => new Promise((resolve => {
module.exports.isNullOrUndefined = function(val) {
return val === null || val === undefined;
};
// Returns a Deferred
module.exports.defer = () => {
let resolve;
let reject;
const promise = new Promise((_resolve, _reject) => {
resolve = _resolve;
reject = _reject;
});
return {resolve, reject, promise};
};