tx-manager/src/utils.js

15 lines
246 B
JavaScript
Raw Normal View History

2020-10-01 07:56:47 +03:00
/**
* A promise that resolves after `ms` milliseconds
*/
2020-10-02 12:55:44 +03:00
const sleep = ms => new Promise(res => setTimeout(res, ms))
2020-10-01 07:56:47 +03:00
2020-10-17 14:37:22 +03:00
const max = (a, b) => (a.gt(b) ? a : b)
2020-10-17 05:22:55 +03:00
2020-10-17 14:37:22 +03:00
const min = (a, b) => (a.lt(b) ? a : b)
2020-10-17 05:22:55 +03:00
2020-10-01 07:56:47 +03:00
module.exports = {
sleep,
2020-10-17 05:22:55 +03:00
max,
min,
2020-10-01 07:56:47 +03:00
}