Skip to content

Add 'origin' for middlewares

Compare
Choose a tag to compare
@oskarhane oskarhane released this 28 Mar 12:48
· 4 commits to master since this release

Breaking changes

Rename the _responseChannel property of a bus.self message to $$responseChannel to make it more clear that it's auto added and shouldn't be of any interest outside of Suber.

Changes

The middleware signature are being changed to

const mw = (send, originObject) => (channel, message, source) => {}

The origin object are mostly useful when in combination with createReduxMiddleware since a origin check is done here to make sure that we don't sent the same message into Suber twice: Suber -> Redux -> Suber.