12 lines
285 B
JavaScript
12 lines
285 B
JavaScript
|
export function getCurrTime() {
|
||
|
return Math.floor(Date.now() / 1000);
|
||
|
}
|
||
|
export function promisify(func) {
|
||
|
return (args = {}) => new Promise((resolve, reject) => {
|
||
|
func(Object.assign(args, {
|
||
|
success: resolve,
|
||
|
fail: reject,
|
||
|
}));
|
||
|
});
|
||
|
}
|