Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/* global require */
const { applyMiddleware, createStore, compose } = require("redux");
const { logger } = require("redux-logger");
const { createActions, handleActions } = require("redux-actions");
const { ProjectChangeListener } = require("./project");
const actions = createActions(
"USER_LOGGED_IN",
"PROJECT_SELECTED",
"RESOURCES_CHANGED",
"RESOURCE_SELECTED",
"DATA_SYNCHRONIZED"
);
const reducer = handleActions({
[actions.userLoggedIn]: (state, action) => ({
...state,
user: action.payload
}),
[actions.projectSelected]: (state, action) => ({
...state,
// @flow
import { createActions } from 'redux-actions'
import typeToReducer from 'type-to-reducer'
import I18n from '../../i18n'
const actions = createActions('SET_LANGUAGE')
const initialState: string = I18n.currentLocale()
const reducer = typeToReducer(
{
[actions.setLanguage]: (state, action) => action.payload
},
initialState
)
export { actions }
export default reducer