feat(decorators): support registering arg by createParameterDecorator
#1680
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is aiming to solve #1325.
It's based on #1330 PR by @russell-dot-js 🙌
Unfortunately, after #1400 that PR contained a lot of conflicts, and I was unable to push a commit with fixes into the upstream repo.
There are some differences between this PR and #1330.
Mainly, the signature of the
createParamDecorator
has been simplified and nowarg
options are the second argument of this function.It also renames
createParamDecorator
tocreateParameterDecorator
(v2 can have breaking changes).The
returnTypeFunc
key has been changed totypeFunc
as we describe the input type (I still need to adjust other decorators' signature).Additionally, docs has been updated to reflect the new feature, so do the examples.
And there's now an entry to changelog about this.