Skip to content

Commit 073e07e

Browse files
Fix InitRxUI to account for order of passed registration namespaces (#3887)
<!-- Please be sure to read the [Contribute](https://github.com/reactiveui/reactiveui#contribute) section of the README --> **What kind of change does this PR introduce?** <!-- Bug fix, feature, docs update, ... --> Bug fix? **What is the current behavior?** <!-- You can also link to an open issue here. --> Originally the `InitializeReactiveUI` function didn't account for order of passed registration, because the allowed namespace dictionary was enumerated instead of the array (which is kind of backwards if you think about it). **What is the new behavior?** <!-- If this is a feature change --> Order of the namespaces is preserved when registering. **What might this PR break?** Multi-platform projects that rely on current non-determinant order may break because of different order of registrations. **Please check if the PR fulfills these requirements** - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) **Other information**: Not sure on what kind of tests/docs are expected, so I am leaving it as draft for now, feel free to undraft if you feel this is OK. Co-authored-by: Glenn <[email protected]>
1 parent 9dbac6e commit 073e07e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ReactiveUI/Mixins/DependencyResolverMixins.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ public static void InitializeReactiveUI(this IMutableDependencyResolver resolver
5858
}
5959

6060
var extraNs =
61-
possibleNamespaces
62-
.Where(kvp => registrationNamespaces.Contains(kvp.Key))
63-
.Select(kvp => kvp.Value)
61+
registrationNamespaces
62+
.Where(ns => possibleNamespaces.ContainsKey(ns))
63+
.Select(ns => possibleNamespaces[ns])
6464
.ToArray();
6565

6666
// Set up the built-in registration

0 commit comments

Comments
 (0)