Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
done: true,
recurrence: 'Daily',
rating: 3
};
const initState: JsonFormsState = {
jsonforms: {
cells: materialCells,
renderers: materialRenderers
}
};
const rootReducer: Reducer = combineReducers({
jsonforms: jsonformsReducer()
});
const store = createStore(rootReducer, initState, devToolsEnhancer({}));
store.dispatch(Actions.init(data, schema, uischema));
// Register custom renderer for the Redux tab
store.dispatch(Actions.registerRenderer(ratingControlTester, RatingControl));
ReactDOM.render(, document.getElementById('root'));
registerServiceWorker();
// Reducer
export const reducer = (state: StoreState, action: ToggleSidebar): StoreState => {
switch (action.type) {
case TOGGLE_SIDEBAR:
return Object.assign({}, state, { isSidebarVisible: !state.isSidebarVisible });
default:
return state;
}
};
// Store
export const initialState: StoreState = { isSidebarVisible: false };
export const store = createStore(
reducer,
initialState,
devToolsEnhancer({}),
);
[
/* middlewares, that wrap the reducer
*(they get the state, can do stuff, apply the reducer, do stuff and return a modified state)
*/
"ngUiRouterMiddleware",
thunk,
piwikMiddleware,
],
[
/* store enhancers (i.e. f::store->store') */
/*
* store enhancer that allows using the redux-devtools
* see https://github.com/zalmoxisus/redux-devtools-extension and
* https://www.npmjs.com/package/ng-redux#using-devtools for details.
*/
devToolsEnhancer({
trace: true,
traceLimit: 10,
serialize: {
immutable: Immutable,
},
}),
// Specify name here, actionsBlacklist, actionsCreators and other options if needed
]
);
}
}
export const toggleSidebar = () => ({ type: TOGGLE_SIDEBAR })
// Reducer
export const reducer = (state: StoreState, action: ToggleSidebar): StoreState => {
switch (action.type) {
case TOGGLE_SIDEBAR:
return Object.assign({}, state, { isSidebarVisible: !state.isSidebarVisible })
default:
return state
}
}
// Store
export const initialState: StoreState = { isSidebarVisible: false }
export const store = createStore(reducer, initialState, devToolsEnhancer({}))
import { devToolsEnhancer } from 'redux-devtools-extension';
import viewReducer from './views/reducer';
import apiReducer from './api/reducer';
import audioReducer from './audio/reducer';
import navReducer from './components/bar/reducer';
const rootReducer = combineReducers({
viewState: viewReducer,
apiState: apiReducer,
audioState: audioReducer,
navState: navReducer,
});
const store = createStore(
rootReducer,
devToolsEnhancer(),
applyMiddleware(thunkMiddleware),
);
export default store;
export default function(initialState) {
const store = createStore(reducer, initialState, devToolsEnhancer());
return store;
}
import {notificationsReducer, NotificationsState} from "./notifications/reducer"
import {tagsReducer, TagsState} from "./tags/reducer"
export interface StoreState {
loggedInUser: LoggedInUserState
notifications: NotificationsState
tags: TagsState
}
const rootReducer: Reducer = combineReducers({
loggedInUser: loggedInUserReducer as any,
notifications: notificationsReducer as any,
tags: tagsReducer as any
})
export const store = createStore(rootReducer, devToolsEnhancer({}))
export * from "./loggedInUser/actions"
export * from "./notifications/actions"
export * from "./tags/actions"
import { createStore, combineReducers } from "redux";
import { Provider } from "react-redux";
import { devToolsEnhancer } from "redux-devtools-extension";
import { BrowserRouter } from "react-router-dom";
import reducers from "./client/reducers/reducers";
import App from "./client/containers/App";
import registerServiceWorker from './registerServiceWorker';
const preloadedState = window.PRELOADED_STATE;
delete window.PRELOADED_STATE;
const store = createStore(
combineReducers(reducers),
preloadedState,
devToolsEnhancer()
);
ReactDOM.render(
,
document.getElementById('root')
);
registerServiceWorker();