Re:Elixir – Why the dot (when calling anonymous functions)?
by claytongulick on Monday August 14, 2023 @08:10PM
(#37128478)
Yes, you're 100% correct, I mixed some stuff up when I was posting the code for simplicity.
Bad example!
I’m not entirely sure what you mean by this, but it doesn’t sound like a correct diagnosis. Each call to `getSFTPConnection` creates a new `ssh2.Client` instance (unless `ssh2.Client`’s constructor does something weird), and the promise can only resolve with the value `ssh.sftp` passes (although there’s a missing error check).