
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
redux-grout
Advanced tools
Redux middleware, actions, and reducers for Grout.
import { createStore, applyMiddleware, compose } from 'redux';
import rootReducer from '../reducers'; // Combined reducers
import thunkMiddleware from 'redux-thunk';
import { createMiddleware } from 'redux-grout';
let groutMiddleware = createMiddleware();
const createStoreWithMiddleware = compose(
// Save for redux middleware
applyMiddleware(thunkMiddleware, groutMiddleware)
)(createStore);
Add reducers to combineReducers function:
import { combineReducers } from 'redux';
import { routerStateReducer } from 'redux-router';
import { Reducers } from 'redux-grout';
const { account, files, entities} = Reducers;
const rootReducer = combineReducers({
account,
files,
entities,
router: routerStateReducer
});
export default rootReducer;
Example of using Actions from redux-grout in a smart component:
import React, { Component, PropTypes } from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { Actions } from 'redux-grout';
class Main extends Component {
constructor(props) {
super(props);
this.onLoginClick = this.onLoginClick.bind(this);
}
onLoginClick(e) {
e.preventDefault();
let testLogin = {username: 'test', password: 'asdfasdf'};
this.props.login(testLogin);
}
render() {
return (
<div className="App">
<button onClick={ this.onLoginClick }>Login</button>
</div>
)
}
}
//Place state of redux store into props of component
function mapStateToProps(state) {
return {
account: state.account
};
}
//Place action methods into props
function mapDispatchToProps(dispatch) {
return bindActionCreators(Actions, dispatch);
}
export default connect(mapStateToProps, mapDispatchToProps)(Main);
FAQs
Redux tools for Grout library.
We found that redux-grout demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.