Skip to content

Immutable event builder #29

Closed
Closed

Description

@fabiojose

Implements an immutable event builder, to builds events instances that are unchangeable after its build.

Depends on #28

Activity

  1. lance commented on May 9, 2020

    @lance
    Member

    @fabiojose I agree that events should probably be immutable - aside from a well-defined path for converting from/to spec versions. Given how the repo has been evolving, how do you think this issue should progress?

  2. grant commented on May 18, 2020

    @grant
    Member

    how do you think this issue should progress?

    If we use JSON for CloudEvents, then we can just Object.freeze our event data to make it immutable.

    Requires #65.

  3. lance commented on May 29, 2020

    @lance
    Member

    I'm going to mark this a stalled for now. TypeScript users now have Object.freeze for regular objects. However, that doesn't work for the CloudEvent class. We'd need to add a freeze() method to the class itself to prevent modification. This is because the setters on the class delegate to this.spec.

  4. github-actions commented on Jun 29, 2020

    @github-actions
    Contributor

    This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

  5. grant commented on Jul 1, 2020

    @grant
    Member

    Marking all CloudEvent fields as readonly should be a solution.

    This is very common and recommended in TypeScript. See vscode's source for examples.

  6. removed
    type/discussionIssues that need to be decided/debated/discussed
    on Jul 1, 2020
  7. lance commented on Jul 3, 2020

    @lance
    Member

    Weird that the bot closed this

  8. lance commented on Jul 21, 2020

    @lance
    Member

    While not exposed via an actual builder, I think #234 should satisfy this issue. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions