How to use the redux-observable.combineEpics.apply function in redux-observable

To help you get started, we’ve selected a few redux-observable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github geosolutions-it / MapStore2 / web / client / plugins / __tests__ / pluginsTestUtils.js View on Github external
export const getPluginForTest = (pluginDef, storeState, plugins) => {
    const PluginImpl = Object.keys(pluginDef).reduce((previous, key) => {
        if (endsWith(key, 'Plugin')) {
            return pluginDef[key];
        }
        return previous;
    }, null);
    const containers = Object.keys(PluginImpl)
        .filter(prop => !plugins || Object.keys(plugins).indexOf(prop + 'Plugin') !== -1)
        .reduce((previous, key) => {
            return { ...previous, [key]: PluginImpl[key]};
        }, {});
    const reducer = combineReducers({ ...(pluginDef.reducers || {}), ...rootReducers });

    const rootEpic = combineEpics.apply(null, Object.keys(pluginDef.epics || {}).map(key => pluginDef.epics[key]) || []);
    const epicMiddleware = createEpicMiddleware(rootEpic);
    const actions = [];
    const store = applyMiddleware(epicMiddleware, createRegisterActionsMiddleware(actions))(createStore)(reducer, storeState);
    return {
        Plugin: (props) => ,
        store,
        actions,
        containers
    };
};
github silentbalanceyh / vertx-ui / src / environment / combiner.js View on Github external
const fnHandler = handlers[key];
        if (Function.prototype.isPrototypeOf(fnHandler)) {
            actionHandler[key] = fnHandler;
        }
    }
    return createReducer(actionHandler, {});
};

const epics = [];
for (const key in datum.epics) {
    if (datum.epics.hasOwnProperty(key)) {
        epics.push(datum.epics[key]);
    }
}
export default {
    epics: combineEpics.apply(this, epics),
    reducers: combineReducers({
        routing: routerReducer,
        do: createEpics(),
        out
    })
};