Add ComponentParameterCollectionBuilder overloaded methods
Closes #751
note: I haven't updated CHANGELOG.md because I couldn't find an appropriate section for the changes for v2.
PR meta checklist
- [ ] Pull request is targeted at
mainbranch for code
or targeted atstablebranch for documentation that is live on bunit.dev. - [x] Pull request is linked to all related issues, if any.
- [x] I have read the CONTRIBUTING.md document.
Code PR specific checklist
- [x] My code follows the code style of this project and AspNetCore coding guidelines.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have updated the appropriate sub section in the CHANGELOG.md.
- [x] I have added, updated or removed tests to according to my changes.
- [x] All tests passed.
Hey @Qwertyluk - thank you for the PR. The change itself looks good. I have two small amendments:
- Could you add a very small example with an explanation in the docs (https://bunit.dev/docs/providing-input/passing-parameters-to-components.html?tabs=csharp)? This will help also users why one would need such a function.
- Can you add your contribution in the
CHANGELOG.md? Under theUnreleasedsection add anotherAddedwith a small text crediting you (I guess you will get the gist if you read some others).
If you just update the changelog like Steven says, then our deployment will add the correct version tag next to it.
I've updated the changelog.
Though I haven't touched the documentation as I'm not sure if these changes are significant enough to require documentation updates.
There was already an overloaded method ComponentParameterCollectionBuilder.Add that supports asynchronous callbacks and accepts Func<Task>. In this PR, I only added the ability to pass arguments for async callbacks so I have a feeling that mentioning these overloads might unnecessarily complicate the documentation.
However, if you believe the documentation should be updated to include the support for asynchronous callback parameters, let me know and I'll make the necessary updates.
Sorry for the delay. LGTM. Will run CI