Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

17 lines
403 B

'use strict';
// Inspired by https://github.com/nodejs/node/blob/949e8851484c016c07f6cc9e5889f0f2e56baf2a/lib/_http_client.js#L706
module.exports = (socket, method, ...args) => {
let call;
if (typeof method === 'function') {
call = method;
} else {
call = () => socket[method](...args);
}
if (socket.writable && !socket.connecting) {
call();
} else {
socket.once('connect', call);
}
};