|
|
|
|
|
by POiNTx
233 days ago
|
|
In Elixir this would be written as: db.getUsers()
|> getExpiredUsers(Date.now())
|> generateExpiryEmails()
|> email.bulkSend()
I think Elixir hits the nail on the head when it comes to finding the right balance between functional and imperative style code. |
|
clock in this case is a thing that was supplied to the class or function. It could just be a function: () -> Instant.
(Setting a global mock clock is too evil, so don't suggest that!)