public static FluxorOptions UsePersist(this FluxorOptions options, Action <PersistMiddlewareOptions> persistMiddlewareOptions = null)
        {
            var middlewareOptions = new PersistMiddlewareOptions();

            persistMiddlewareOptions?.Invoke(middlewareOptions);
            options.AddMiddleware <PersistMiddleware>();
            options.Services.AddScoped(_ => middlewareOptions);
            return(options);
        }
        /// <summary>
        /// Enables interaction with the brower tool Redux Dev Tools
        /// </summary>
        /// <param name="options">The current options</param>
        /// <param name="updateReduxOptions">An action to update the options</param>
        /// <returns></returns>
        public static FluxorOptions UseReduxDevTools(
            this FluxorOptions options,
            Action <ReduxDevToolsMiddlewareOptions> updateReduxOptions = null)
        {
            var reduxOptions = new ReduxDevToolsMiddlewareOptions(options);

            updateReduxOptions?.Invoke(reduxOptions);

            options.AddMiddleware <ReduxDevToolsMiddleware>();
            options.Services.AddScoped <ReduxDevToolsInterop>();
            options.Services.AddScoped(_ => reduxOptions);
            options.UseRouting();
            return(options);
        }
Exemple #3
0
 public static FluxorOptions UseRouting(this FluxorOptions options)
 {
     options.AddMiddleware <RoutingMiddleware>();
     return(options);
 }