
Security News
The Next Open Source Security Race: Triage at Machine Speed
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.
A helper to let you wait for redux actions to be processed in a universal app
A helper to let you wait for redux actions to be processed in a universal app.
npm install redux-wait
applyMiddleware with redux-await- var applyMiddleware = require('redux').applyMiddleware;
+ var applyMiddleware = require('redux-wait');
This will add an extra method to your store called store.renderToString.
If you're not using any custom middleware and you're not using redux-thunk, you can skip this step.
If you are writing asynchronous middleware, you need to make sure your middleware returns a promise that is only resolved once it has finished processing the action. redux-promise is a perfect example of how to do this.
If you are using redux-thunk, you can only use it synchronously, or it will break server rendering.
Good:
// action creator
function loadUser(login) {
return (dispatch, getState) => {
const user = getState().entities.users[login];
if (user) {
return null;
}
return dispatch(fetchUser(login));
};
}
Bad:
// action creator
function loadUser(login) {
return (dispatch, getState) => {
const user = getState().entities.users[login];
if (user) {
return null;
}
$.getJson('/user/' + login, function (data) {
// The server won't wait for this action :(
dispatch({type: 'LOADED_USER', user: data});
});
};
}
Good:
componentWillMount() {
if (!this.props.isLoading && !this.props.user) {
this.props.dispatch(loadUser());
}
}
Bad:
componentWillMount() {
if (!this.props.user) {
this.props.dispatch(loadUser());
}
}
// N.B. `createStore` is the result of using redux-wait instead of Redux.applyMiddleware
let store = createStore();
let element = <Root history={new MemoryHistory([req.url])} store={store} />;
store.renderToString(React, element).done(function (html) {
res.send(
indexHtml.replace(
'{{content}}',
html
).replace(
'{{state}}',
stringify(store.getState())
)
);
}, next);
MIT
FAQs
A helper to let you wait for redux actions to be processed in a universal app
We found that redux-wait demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Claude Opus 4.6 has uncovered more than 500 open source vulnerabilities, raising new considerations for disclosure, triage, and patching at scale.

Research
/Security News
Malicious dYdX client packages were published to npm and PyPI after a maintainer compromise, enabling wallet credential theft and remote code execution.

Security News
gem.coop is testing registry-level dependency cooldowns to limit exposure during the brief window when malicious gems are most likely to spread.