File tree Expand file tree Collapse file tree 7 files changed +19
-5
lines changed
Fluxor.Blazor.Web.ReduxDevTools/Internal
DependencyInjection/Wrappers
Tutorials/02-Blazor/02D-ReduxDevToolsTutorial/ReduxDevToolsTutorial/Client/Store/CounterUseCase Expand file tree Collapse file tree 7 files changed +19
-5
lines changed Original file line number Diff line number Diff line change 11# Releases
22
3+ ## New in 6.8
4+ * Added DebuggerBrowsable property to FeatureAttribute to prevent state being sent to ReduxDevTools ([ #541 ] ( https://github.com/mrpmorris/Fluxor/issues/541 ) )
5+
36## New in 6.7
47* Fix StoreInitialize error ([ #535 ] ( https://github.com/mrpmorris/Fluxor/issues/535 ) )
58* Fix NullReferenceException when using ReduxDevTools ([ #543 ] ( https://github.com/mrpmorris/Fluxor/issues/543 ) )
Original file line number Diff line number Diff line change @@ -83,7 +83,8 @@ public override void AfterDispatch(object action)
8383 private IDictionary < string , object > GetState ( )
8484 {
8585 var state = new Dictionary < string , object > ( ) ;
86- foreach ( IFeature feature in Store . Features . Values . OrderBy ( x => x . GetName ( ) ) )
86+ var serializableFeatures = Store . Features . Values . Where ( x => x . DebuggerBrowsable ) ;
87+ foreach ( IFeature feature in serializableFeatures . OrderBy ( x => x . GetName ( ) ) )
8788 state [ feature . GetName ( ) ] = feature . GetState ( ) ;
8889 return state ;
8990 }
Original file line number Diff line number Diff line change @@ -7,11 +7,11 @@ internal class FeatureStateWrapper<TState> : Feature<TState>
77 private readonly string Name ;
88 private readonly Func < object > CreateInitialStateFunc ;
99
10- public FeatureStateWrapper (
11- FeatureStateInfo info )
10+ public FeatureStateWrapper ( FeatureStateInfo info )
1211 {
1312 Name = info . FeatureStateAttribute . Name ?? typeof ( TState ) . FullName ;
1413 MaximumStateChangedNotificationsPerSecond = info . FeatureStateAttribute . MaximumStateChangedNotificationsPerSecond ;
14+ DebuggerBrowsable = info . FeatureStateAttribute . DebuggerBrowsable ;
1515 CreateInitialStateFunc = info . CreateInitialStateFunc ;
1616 }
1717
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ public abstract class Feature<TState> : IFeature<TState>
1717 /// <see cref="IFeature.GetState"/>
1818 public virtual object GetState ( ) => State ;
1919
20+ /// <see cref="IFeature.DebuggerBrowsable"/>
21+ public virtual bool DebuggerBrowsable { get ; set ; }
22+
2023 /// <see cref="IFeature.RestoreState(object)"/>
2124 public virtual void RestoreState ( object value ) => State = ( TState ) value ;
2225
Original file line number Diff line number Diff line change @@ -7,5 +7,6 @@ public class FeatureStateAttribute : Attribute
77{
88 public string Name { get ; set ; }
99 public string CreateInitialStateMethodName { get ; set ; }
10+ public bool DebuggerBrowsable { get ; set ; } = true ;
1011 public byte MaximumStateChangedNotificationsPerSecond { get ; set ; }
1112}
Original file line number Diff line number Diff line change @@ -14,10 +14,16 @@ public interface IFeature
1414 /// <returns>The unique name of the feature</returns>
1515 string GetName ( ) ;
1616
17+ /// <summary>
18+ /// Gets a value indicating whether the property should be visible
19+ /// in any attached debugger (e.g. ReduxDevTools).
20+ /// </summary>
21+ bool DebuggerBrowsable { get ; }
22+
1723 /// <summary>
1824 /// If greater than 0, the feature will not execute state changes
1925 /// more often than this many times per second. Additional notifications
20- /// will be surpressed , and observers will be notified of the latest
26+ /// will be suppressed , and observers will be notified of the latest
2127 /// state when the time window has elapsed to allow another notification.
2228 /// </summary>
2329 byte MaximumStateChangedNotificationsPerSecond { get ; set ; }
Original file line number Diff line number Diff line change 22
33namespace FluxorBlazorWeb . ReduxDevToolsTutorial . Client . Store . CounterUseCase
44{
5- [ FeatureState ( Name = "Counter" ) ]
5+ [ FeatureState ( Name = "Counter" , DebuggerBrowsable = false ) ]
66 public class CounterState
77 {
88 public int ClickCount { get ; }
You can’t perform that action at this time.
0 commit comments