Skip to content

Instantly share code, notes, and snippets.

@steezeburger
Created February 7, 2017 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steezeburger/b5c972ec2f3b00f2e5bd8f2053f8caca to your computer and use it in GitHub Desktop.
Save steezeburger/b5c972ec2f3b00f2e5bd8f2053f8caca to your computer and use it in GitHub Desktop.
import { takeEvery } from 'redux-saga'; // works w/ deprecation warning
// import { takeEvery } from 'redux-saga/effects'; // proper according to docs but does not work
export const dispatchAfter = (actions, secondAction) => function*() {
yield* takeEvery(actions, function* (action) {
yield secondAction(action);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment