/// <see cref="IStore.AddMiddleware(IMiddleware)"/> public void AddMiddleware(IMiddleware middleware) { Middlewares.Add(middleware); ReversedMiddlewares.Insert(0, middleware); // Initialize the middleware immediately if the store has already been initialized, otherwise this will be // done the first time Dispatch is called if (HasActivatedStore) { middleware.Initialize(this); middleware.AfterInitializeAllMiddlewares(); } }