-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wired up filter updates to state filtering
- Loading branch information
Joseph Schick
committed
Nov 9, 2022
1 parent
852b299
commit 72a7559
Showing
6 changed files
with
166 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// // Copyright (c) Microsoft Corporation. | ||
// // Licensed under the MIT License. | ||
|
||
using EventLogExpert.Library.Models; | ||
using EventLogExpert.Store.EventLog; | ||
using Fluxor; | ||
|
||
namespace EventLogExpert.Store.FilterPane; | ||
|
||
public class FilterPaneEffects | ||
{ | ||
private readonly IState<FilterPaneState> _state; | ||
|
||
public FilterPaneEffects(IState<FilterPaneState> state) => _state = state; | ||
|
||
[EffectMethod(typeof(FilterPaneAction.ApplyFilters))] | ||
public Task HandleApplyFiltersAction(IDispatcher dispatcher) | ||
{ | ||
List<Func<DisplayEventModel, bool>> filters = new(); | ||
|
||
foreach (var filter in _state.Value.CurrentFilters) | ||
{ | ||
if (filter.Comparison is not null) | ||
{ | ||
filters.Add(filter.Comparison); | ||
} | ||
} | ||
|
||
dispatcher.Dispatch(new EventLogAction.FilterEvents(filters)); | ||
|
||
return Task.CompletedTask; | ||
} | ||
} |
This file contains 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
This file contains 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