Added test project & github action to run tests#1
Open
Timmoth wants to merge 13 commits intomrpmorris:release/0.5.0from
Open
Added test project & github action to run tests#1Timmoth wants to merge 13 commits intomrpmorris:release/0.5.0from
Timmoth wants to merge 13 commits intomrpmorris:release/0.5.0from
Conversation
mrpmorris
requested changes
Apr 10, 2022
|
|
||
|
|
||
| [Fact] | ||
| public void ReducerUpdatesStateWhenInvoked() |
Owner
There was a problem hiding this comment.
Taking into account the filename is the Given, I like my test methods to be named WhenXxxxx_ThenYyyyyy
| Func<TSubState, TDelta, Result<TSubState>> reducer) | ||
| => | ||
| new ObjectResultMapper<TState, TSubState, TDelta>(subStateSelector, reducer); | ||
| Func<TState, TSubState> subStateSelector, Func<TSubState, TDelta, Result<TSubState>> reducer) => |
Owner
There was a problem hiding this comment.
I prefer all of the original code in this case.
| Func<TElement, TDelta, Result<TElement>> reducer) | ||
| => | ||
| new ImmutableArrayResultMapper<TState, TElement, TDelta>(subStateSelector, reducer); | ||
| Func<TState, ImmutableArray<TElement>> subStateSelector, Func<TElement, TDelta, Result<TElement>> reducer) => |
Owner
There was a problem hiding this comment.
I prefer the original code here too.
| { | ||
| public static implicit operator (bool changed, TState state)(Result<TState> result) => (result.Changed, result.State); | ||
| public static implicit operator Result<TState>((bool changed, TState value) value) => new Result<TState>(value.changed, value.value); | ||
| public static implicit operator Result<TState>((bool changed, TState value) value) => new(value.changed, value.value); |
Owner
There was a problem hiding this comment.
This is okay, but could you also change the parameter names to TState state and the param itself to tuple
Source/Morris.Reducible/Reducer.cs
Outdated
| { | ||
| bool anyChanged = false; | ||
| for (int o = 0; o < allReducers.Length; o++) | ||
| foreach (var reducer in allReducers) |
Owner
There was a problem hiding this comment.
I think a for loop is faster than a foreach
mrpmorris
reviewed
Apr 12, 2022
mrpmorris
reviewed
Apr 12, 2022
Owner
|
I've tried to rebase this off release/0.5.0 but there are conflicts. Would you like to resolve them so I can merge in your changes? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.