Closed livebit closed 7 years ago
Hi @livebit, thanks for the PR.
Right now, redux-socket.io
makes the assumption that you've already handled your non-action dispatches (thunks, promises, whatever) further up in the middleware chain. I'm a bit inclined to keep it that way so I don't have to write code to detect all the non-action things that might be dispatched.
Is there a particular reason that you need the redux-thunk
to come after redux-socket.io
in the middleware chain that I'm not familiar with?
Hi @itaylor,
I was little suprised that changing middleware chain order caused error. In my humble opinion as far as redux-socket.io
handles only actions that are objects with property type everything else should be ignored instead of throwing error. I guess something like this would be even better solution:
if ( typeof action !== 'object' || !action.hasOwnProperty('type') ) return false
We resolved this with PR#25
Using thunk middleware action creator can return a function instead of an action object (Async Action Creators: http://redux.js.org/docs/advanced/AsyncActions.html).