mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-30 02:56:20 -05:00
590f505a61
This reverts commit1b1b396e92
, reversing changes made toa144bab0e6
.
25 lines
1 KiB
JavaScript
25 lines
1 KiB
JavaScript
const combineReducers = require('redux').combineReducers;
|
|
const defaults = require('lodash.defaults');
|
|
|
|
const messageCountReducer = require('./message-count.js').messageCountReducer;
|
|
const permissionsReducer = require('./permissions.js').permissionsReducer;
|
|
const sessionReducer = require('./session.js').sessionReducer;
|
|
|
|
/**
|
|
* Returns a combined reducer to be used for a page in `render.jsx`.
|
|
* The reducers used globally are applied here - session and permissions
|
|
* - and any reducers specific to the page should be passed into
|
|
* `render()` as an object (which will then be passed to the function
|
|
* below).
|
|
* @param {object} opts key/value where the key is the name of the
|
|
* redux state, value is the reducer function.
|
|
* @return {object} combined reducer to be used in the redux store
|
|
*/
|
|
module.exports = opts => {
|
|
opts = opts || {};
|
|
return combineReducers(defaults(opts, {
|
|
session: sessionReducer,
|
|
permissions: permissionsReducer,
|
|
messageCount: messageCountReducer
|
|
}));
|
|
};
|