public void UseMiddleware_add_middleware_that_no_options()
        {
            var options = new LoggerOptions();
            var store   = new StoreBuilder <AppState>(new AppReducer())
                          .UseDummy()
                          .UseLogger(options)
                          .Build();

            Assert.Equal(1, options.Buffer.Count);
            Assert.Equal(typeof(DummyAction).FullName, options.Buffer[0]);
        }
Exemplo n.º 2
0
 public static IStoreBuilder <TState> UseLogger <TState>(this IStoreBuilder <TState> store, LoggerOptions options)
 {
     return(store.UseMiddleware <LoggerMiddleware <TState> >(options));
 }
Exemplo n.º 3
0
 public LoggerMiddleware(IStore <TState> store, DispatchDelegate next, LoggerOptions options)
 {
     _store   = store;
     _next    = next;
     _options = options;
 }
Exemplo n.º 4
0
 public LoggerMiddleware(IStore <TState> store, Dispatcher next, LoggerOptions options)
 {
     this.store   = store;
     this.next    = next;
     this.options = options;
 }