Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
4lessandrodev committed Mar 19, 2024
1 parent 0803c15 commit 4bbda8d
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 @@ -444,15 +444,15 @@ export default class Order extends Aggregate<Props> {
this.props.payment = payment;
// Add an event to indicate that the order has been paid.
// Assuming OrderPaidEvent is a class representing
// the event of order payment.
// the event of order payment.
this.addEvent(new OrderPaidEventHandler());
return this;
}

// Static method to create an instance of Order.
// Returns a Result, which can be Ok (success) or Fail (failure).
// The value of the Result is an instance of Order,
// if creation is successful.
// if creation is successful.
public static create(props: Props): Result<Order> {
return Ok(new Order(props));
}
Expand All @@ -465,7 +465,7 @@ How to use events
```ts

order.addEvent('OTHER_EVENT', (...args) => {
console.log(args);
console.log(args);
});

// Or add an EventHandler instance
Expand Down

0 comments on commit 4bbda8d

Please sign in to comment.