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

feat: new event logger #311

Merged
merged 1 commit into from
Jan 1, 2024
Merged

feat: new event logger #311

merged 1 commit into from
Jan 1, 2024

Conversation

joe-p
Copy link
Contributor

@joe-p joe-p commented Jan 1, 2024

This is a breaking change to how events are defined and called. Previously EventLogger would take a tuple of types as its type argument, but now it must be a type literal. This is so developers can easily define name and desc fields for event args in the ABI JSON via properties and TSDoc comments.

Previously

  myEvent = new EventLogger<[Application, number]>();

  events(): void {
    this.myEvent.log(this.app, 1);
  }

Now

  /**
   * This is my event
   * It has some args
   */
  myEvent = new EventLogger<{
    /** Some app */
    app: Application;
    /** Some number */
    num: number;
  }>();

  events(): void {
    this.myEvent.log({ app: this.app, num: 1 });
  }

Copy link

netlify bot commented Jan 1, 2024

Deploy Preview for tealscript canceled.

Name Link
🔨 Latest commit a89acf7
🔍 Latest deploy log https://app.netlify.com/sites/tealscript/deploys/6592e846b1457b0008aec137

@joe-p joe-p merged commit c20bce6 into dev Jan 1, 2024
5 checks passed
@joe-p joe-p deleted the feat/new_event_logger branch May 5, 2024 12:51
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

Successfully merging this pull request may close these issues.

1 participant