You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
Replace Bluebird.try
This commit is contained in:
10
src/utils.js
10
src/utils.js
@@ -737,3 +737,13 @@ module.exports.promiseMapSeries = async (promises, fn) => {
|
||||
await fn(await o);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports.promiseTry = (fn) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
fn().then(resolve, reject);
|
||||
} catch (e) {
|
||||
reject(e);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user