tx-manager/src/utils.js
2020-10-17 14:37:22 +03:00

15 lines
246 B
JavaScript

/**
* A promise that resolves after `ms` milliseconds
*/
const sleep = ms => new Promise(res => setTimeout(res, ms))
const max = (a, b) => (a.gt(b) ? a : b)
const min = (a, b) => (a.lt(b) ? a : b)
module.exports = {
sleep,
max,
min,
}