Skip to content

Move processingReason to Ui state to organize the main state more consistantly. Fixes #605

Antoine requested to merge ZeHiro/kresus:processingreason into master

One question remains, after this, the reduceImportInstance in store.settings is basically doing nothing, except logging (here)

If we want to keep logging, and delete this reducer, we could just add a simple middlware to redux something like that would to things well :

logger = store => next => action => {
    let { status } = action;
    if (status === SUCCESS) {
        debug(`Action ${action.type} completed with success`);
    }else if (status === FAIL) {
        debug(`Action ${action.type} failed with error:`, action.error);
    } else {
         debug(`Action ${action.type} started`)
    }
    return next(action);
}

I have tested the logger middleware, works as expected. @all what do you think ? This middlware could allow us to cleanup a lot of code in the store/reducers. See http://redux.js.org/docs/advanced/Middleware.html for more information on the topic.

Edited by Antoine

Merge request reports