Skip to content
This repository has been archived by the owner on Feb 4, 2021. It is now read-only.

Commit

Permalink
some comments outlinign why you shouldn't look at the middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
freaktechnik committed Sep 19, 2017
1 parent 753e266 commit d78cab5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/list/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default (port) => ({ getState, dispatch }) => (next) => (action) => {
else if(action.command) {
port.send(action.command, action.payload);
}
// State changes that trigger a backend command
// State changes that trigger a backend command (i.e. everything that's wrong with this app)
else if(action.type === "setTab") {
// This has to be aborted, else the loading state is set when payload === 3
if(state.ui.tab === action.payload) {
Expand Down Expand Up @@ -147,6 +147,8 @@ export default (port) => ({ getState, dispatch }) => (next) => (action) => {
return;
}

// Finally your default middleware end and no more ugly hacks.

if(action.type) {
return next(action);
}
Expand Down

0 comments on commit d78cab5

Please sign in to comment.