redux-rabbit
v0.0.3
Published
redux client for rabbitMQ
Downloads
4
Readme
redux-rabbit
A redux enabled library for rabbitMQ WebStomp.
All the patterns from the rabbitMQ tutorial are supplied, alongside some new ones.
Installation:
npm install redux-rabbit
As a react decorator:
import { connect } from 'react-redux';
import { withReduxRabbit } from 'redux-rabbit';
@connect()
@withReduxRabbit({
connect: true,
config: {
endpoint: 'ws://user:password@rabbitMQ:port/stomp/websocket'
}
})
export default class MyMainComponent extends React.Component {
onComponentWillMount() {
console.log( this.props.mq ) //redux-rabbit instance
}
....
used inside of actions:
import { ReduxRabbitInstance as MQ } from 'redux-rabbit'
myAction = () => {
console.log( MQ ) //redux-rabbit instance
}
or on an action creator class:
@withReduxRabbit()
export default class MyActions {
myAction( args ) {
console.log( this.mq ); //redux-rabbit instance
}