Skip to content

Instantly share code, notes, and snippets.

@p14n
Created May 15, 2018 20:05
Show Gist options
  • Save p14n/20f5ec065207e83abd11abb814f4f52b to your computer and use it in GitHub Desktop.
Save p14n/20f5ec065207e83abd11abb814f4f52b to your computer and use it in GitHub Desktop.
middleware
const contractService = store => next => action => {
switch (action.type) {
...
case "pay":
contract
.withdraw(action.password, { from: action.payee })
.catch(e => next(failed(e)));
...
default:
next(action);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment