Exemplo n.º 1
0
        protected override void Handle(CommitRequest aRequest)
        {
            Logger.LogDebug($"{GetType().FullName}");
            Logger.LogDebug($"{aRequest.Type}");

            ReduxDevToolsInterop.DispatchInit(Store.GetSerializableState());
        }
Exemplo n.º 2
0
        public async Task <TResponse> Handle(
            TRequest aRequest,
            CancellationToken aCancellationToken,
            RequestHandlerDelegate <TResponse> aNext)
        {
            Logger.LogDebug($"{GetType().Name}: Start");
            Logger.LogDebug($"{GetType().Name}: Call next");
            TResponse response = await aNext();

            Logger.LogDebug($"{GetType().Name}: Start Post Processing");
            try
            {
                if (!(aRequest is IReduxRequest) && ReduxDevToolsInterop.IsEnabled)
                {
                    ReduxDevToolsInterop.Dispatch(aRequest, Store.GetSerializableState());
                }
                Logger.LogDebug($"{GetType().Name}: End");
                return(response);
            }
            catch (Exception e)
            {
                Logger.LogDebug($"{GetType().Name}: Error: {e.Message}");
                Logger.LogDebug($"{GetType().Name}: InnerException: {e.InnerException?.Message}");
                Logger.LogDebug($"{GetType().Name}: StackTrace: {e.StackTrace}");
                throw;
            }
        }
Exemplo n.º 3
0
 public CommitHandler(
     ILogger <CommitHandler> aLogger,
     IReduxDevToolsStore aStore,
     ReduxDevToolsInterop aReduxDevToolsInterop)
 {
     Logger = aLogger;
     Logger.LogDebug($"{GetType().FullName} constructor");
     Store = aStore;
     ReduxDevToolsInterop = aReduxDevToolsInterop;
 }
Exemplo n.º 4
0
 public ReduxDevToolsBehavior(
     ILogger <ReduxDevToolsBehavior <TRequest, TResponse> > aLogger,
     ReduxDevToolsInterop aReduxDevToolsInterop,
     IReduxDevToolsStore aStore)
 {
     Logger = aLogger;
     Logger.LogDebug($"{GetType().Name} constructor");
     Store = aStore;
     ReduxDevToolsInterop = aReduxDevToolsInterop;
 }
Exemplo n.º 5
0
 //TODO: This won't run as a PostProcessor for some reason MediatR never creates it.
 public Task Process(TRequest aRequest, TResponse aResponse)
 {
     try
     {
         Logger.LogDebug($"{GetType().Name}: Start Post Processing");
         if (!(aRequest is IReduxRequest))
         {
             ReduxDevToolsInterop.Dispatch(aRequest, Store.GetSerializableState());
         }
         Logger.LogDebug($"{GetType().Name}: End");
     }
     catch (Exception e)
     {
         Logger.LogDebug($"{GetType().Name}: Error: {e.Message}");
         Logger.LogDebug($"{GetType().Name}: InnerException: {e.InnerException?.Message}");
         Logger.LogDebug($"{GetType().Name}: StackTrace: {e.StackTrace}");
         throw;
     }
     return(Task.CompletedTask);
 }