![JAR search and dependency download from the Maven repository](/logo.png)
com.netopyr.reduxfx.middleware.LoggingMiddleware Maven / Gradle / Ivy
package com.netopyr.reduxfx.middleware;
import com.netopyr.reduxfx.updater.Update;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.function.BiFunction;
public class LoggingMiddleware implements Middleware {
private static final Logger LOG = LoggerFactory.getLogger(LoggingMiddleware.class);
@Override
public BiFunction> apply(BiFunction> next) {
return (oldState, action) -> {
final Update newState = next.apply(oldState, action);
LOG.debug("prev state: {}", oldState);
LOG.debug("action: {}", action);
LOG.debug("next state: {}", newState);
return newState;
};
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy