Skip to content

Update README to expand on what happens with decorators that return nothing#549

Open
trusktr wants to merge 1 commit into
tc39:masterfrom
trusktr:patch-2
Open

Update README to expand on what happens with decorators that return nothing#549
trusktr wants to merge 1 commit into
tc39:masterfrom
trusktr:patch-2

Conversation

@trusktr

@trusktr trusktr commented Oct 17, 2024

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread README.md
```

`Input` and `Output` here represent the values passed to and returned from a given decorator. Each type of decorator has a different input and output, and these are covered below in more detail. All decorators can choose to return nothing, which defaults to using the original, undecorated value.
`Input` and `Output` here represent the values passed to and returned from a given decorator. Each type of decorator has a different input and output, and these are covered below in more detail. All decorators can choose to return nothing (undefined, or void in TypeScript), which defaults to using the original undecorated value, or to using the latest value returned by a decorator that has already ran on the same element.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rationale is that it would be surprising if a void returning function would reset a previous decorators new value back to the original value.

I chose to put "undefined" or "void" here because those are terms I thought to search for when looking for this detail, but couldn't find it.

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.

2 participants