Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update example code - workinging with haxe 4.3.4 / tink #28

Open
realGnargh opened this issue May 27, 2024 · 1 comment
Open

Update example code - workinging with haxe 4.3.4 / tink #28

realGnargh opened this issue May 27, 2024 · 1 comment

Comments

@realGnargh
Copy link

smtpmailer.SmtpMailer.connect({
  host: 'hostname',
  port: 587,
  auth: {
    username: 'user',
    password: 'pass'
  }
}).next(mailer ->
  mailer.send(email).next(
    _ -> mailer.close()
  )
).handle(function(res) {
  switch res {
    case Success(_):
      trace('Email sent!');
    case Failure(e): {
      trace('Something went wrong: '+e);
    }
  }
});

should change too

    _ -> mailer.close

(no brackets)

as you get an error in current version:

characters 20-34 : Cannot use Void as value
@kevinresol
Copy link
Collaborator

kevinresol commented May 28, 2024

I think you should replace .next with .withSideEffect instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants