Combiners registration via Setup.FillValueCombiners() override #4615
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.
✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)
Feature
There is no easy way to register
ValueCombiner
. The only way is to provide a custom implementation ofBindingBuilder
, which seems like overkill for such a task.🆕 What is the new behavior (if this is a feature change)?
This PR adds the
FillValueCombiners(IMvxValueCombinerRegistry registry)
overload to the platform-specific Setup classes (MvxIosSetup
,MvxMacSetup
, etc.). This behaves the same way as thevoid FillValueConverters(IMvxValueConverterRegistry registry)
for the converters. This gives the user with exactly the same experience as the for converters (except the naming-convention-based autoregistration, which was considered problematic from a performance point of view). With this overload, the developer able to easily register the combiners, either manually one-by-one or with assembly-scan or whatever.💥 Does this PR introduce a breaking change?
No
🐛 Recommendations for testing
Nothing special, but worth remembering that
name
in the registration process should be without suffixes and prefixes. For example, for theMvxMySuperValueCombiner
the nameMySuper
should be used during registration.📝 Links to relevant issues/docs
#4371
🤔 Checklist before submitting