// Path: droidux/src/main/java/info/izumin/android/droidux/Action.java
// public interface Action {
// }
// 
// Path: droidux/src/main/java/info/izumin/android/droidux/Middleware.java
// public abstract class Middleware<S extends BaseStore> {
//     public static final String TAG = Middleware.class.getSimpleName();
// 
//     private S store;
//     private Dispatcher dispatcher;
// 
//     public void onAttach(S store, Dispatcher dispatcher) {
//         this.store = store;
//         this.dispatcher = dispatcher;
//     }
// 
//     protected S getStore() {
//         return store;
//     }
// 
//     protected Dispatcher getDispatcher() {
//         return dispatcher;
//     }
// 
//     public abstract Flowable<Action> beforeDispatch(Action action);
//     public abstract Flowable<Action> afterDispatch(Action action);
// }


import info.izumin.android.droidux.Action;
import info.izumin.android.droidux.Middleware;
import io.reactivex.Flowable;
import io.reactivex.functions.Function;
package info.izumin.android.droidux.thunk;


/**
 * Created by izumin on 11/29/15.
 */
public class ThunkMiddleware extends Middleware {
    public static final String TAG = ThunkMiddleware.class.getSimpleName();

    @Override
    public Flowable<Action> beforeDispatch(final Action action) {
// Path: droidux/src/main/java/info/izumin/android/droidux/Action.java
// public interface Action {
// }
// 
// Path: droidux/src/main/java/info/izumin/android/droidux/Middleware.java
// public abstract class Middleware<S extends BaseStore> {
//     public static final String TAG = Middleware.class.getSimpleName();
// 
//     private S store;
//     private Dispatcher dispatcher;
// 
//     public void onAttach(S store, Dispatcher dispatcher) {
//         this.store = store;
//         this.dispatcher = dispatcher;
//     }
// 
//     protected S getStore() {
//         return store;
//     }
// 
//     protected Dispatcher getDispatcher() {
//         return dispatcher;
//     }
// 
//     public abstract Flowable<Action> beforeDispatch(Action action);
//     public abstract Flowable<Action> afterDispatch(Action action);
// }


// Path: middlewares/droidux-thunk/src/main/java/info/izumin/android/droidux/thunk/ThunkMiddleware.java
import info.izumin.android.droidux.Action;
import info.izumin.android.droidux.Middleware;
import io.reactivex.Flowable;
import io.reactivex.functions.Function;

package info.izumin.android.droidux.thunk;


/**
 * Created by izumin on 11/29/15.
 */
public class ThunkMiddleware extends Middleware {
    public static final String TAG = ThunkMiddleware.class.getSimpleName();

    @Override
    public Flowable<Action> beforeDispatch(final Action action) {
        if (action instanceof AsyncAction) {