Skip to content

Commit

Permalink
Merge pull request #1 from philipgiuliani/patch-1
Browse files Browse the repository at this point in the history
Fix example in README
  • Loading branch information
renatillas authored Aug 6, 2024
2 parents ff2b7fa + bb33fa3 commit daa7ab5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gleam add eventsourcing
```
```gleam
import eventsourcing
import eventsourcing/postgres_store
import eventsourcing/memory_store
pub type BankAccount {
BankAccount(opened: Bool, balance: Float)
Expand Down Expand Up @@ -41,8 +41,8 @@ pub fn handle(
}
WithDrawMoney(amount) -> {
let balance = bank_account.balance -. amount
case amount >. 0.0 {
True -> Ok([CustomerDepositedCash(amount:, balance:)])
case amount >. 0.0 && balance >. 0.0 {
True -> Ok([CustomerWithdrewCash(amount:, balance:)])
False -> Error(Nil)
}
}
Expand Down

0 comments on commit daa7ab5

Please sign in to comment.