tx-manager/src/utils.js

15 lines
246 B
JavaScript
Raw Normal View History

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