Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const makeShit = (bb) => {
const reducer = bbReducerShim(bb);
const enhancer = bbStoreEnhancer(bb);
const store = createStore(
reducer,
{},
compose(
applyMiddleware(createLogger()),
enhancer
)
);
bb.on('__HELLO_ENHANCER__', (action) => store.dispatch(action, { silent: true }));
return store;
};
import { withTranslation } from '@waldur/i18n';
import { setFilterQuery } from '../store/actions';
import { getFilterName } from '../store/selectors';
import { FilterBar } from './FilterBar';
const mapStateToProps = state => ({
filterQuery: getFilterName(state),
});
const mapDispatchToProps = dispatch => ({
setFilterQuery: query => dispatch(setFilterQuery(query)),
});
const enhance = compose(
connect(mapStateToProps, mapDispatchToProps),
withTranslation,
);
export const FilterBarContainer = enhance(FilterBar);
function getStore(opt) {
const store = createStore(
combineReducers({
[FORM_MOUNT]: formReducer
}),
compose(
!IS_PROD && window.__REDUX_DEVTOOLS_EXTENSION__
? window.__REDUX_DEVTOOLS_EXTENSION__()
: (f) => f
)
);
return store;
}
import { connect } from 'react-redux';
import { withTranslation } from 'react-i18next';
import { settingsUpdated } from '../../../actions/settings';
import { toastDisplayed } from '../../../actions/toaster';
import AnalyticsDialog from './analyticsDialog';
const mapStateToProps = state => ({
settings: state.settings,
});
const mapDispatchToProps = {
settingsUpdated,
toastDisplayed,
};
export default compose(
connect(mapStateToProps, mapDispatchToProps),
withTranslation(),
)(AnalyticsDialog);
export default function createReduxStore(): Store {
const reducer = combineReducers(assign({}, reducers, {
routing: routerReducer,
}));
return createStore(
reducer,
getInitialState(),
compose(...getStoreEnhancers())
);
}
{props.userManageIsVisible && (
<div>
</div>
)}
);
const mapStateToProps = state => ({
userManageIsVisible: userManageIsVisible(state),
isVisibleForSupportOrStaff: isVisibleForSupportOrStaff(state),
});
const enhance = compose(withTranslation, connect(mapStateToProps));
export const UserDetailsView = enhance(PureUserDetailsView);
import logger from 'redux-logger';
import throttle from 'lodash.throttle';
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly';
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import reducers from './reducers';
import { saveState } from './localStorage';
let composer;
if (process.env.NODE_ENV === 'development') {
composer = compose(
applyMiddleware(logger, thunk),
composeWithDevTools(),
);
} else {
composer = compose(applyMiddleware(thunk));
}
const store = createStore(
reducers,
composer,
);
store.subscribe(throttle(() => saveState(store.getState()), 1000));
export default store;
import { createStore, compose, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import logger from 'redux-logger';
import rootReducer from '../reducers/rootReducer';
/**
* creating store for application
*/
const store = compose(applyMiddleware(thunk, logger))(createStore)(rootReducer);
export default store;