fusion-redux-action-emitter-enhancer

Redux store enhancer that emits actions via an injected event emitter

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
fusion-redux-action-emitter-enhancer
0.1.55 years ago5 years agoMinified + gzip package size for fusion-redux-action-emitter-enhancer in KB

Readme

fusion-redux-action-emitter-enhancer
Build status
Redux store enhancer that emits actions via an injected event emitter.

Example

// src/main.js
import UniversalEvents from 'fusion-plugin-universal-events';
import Redux from 'fusion-plugin-react-redux'
import fetch from 'unfetch';
import reduxActionEnhancerFactory from 'fusion-redux-action-emitter-enhancer';
import reducer from './reducers/root.js'

export default function start() {
  const app = new App(root);

  const EventEmitter = app.plugin(UniversalEvents, {fetch});
  const enhancer = reduxActionEnhancerFactory(EventEmitter);
  app.plugin(Redux, {reducer, enhancer});

  return app;
}

// src/reducers/root.js
export default (state, action) => {
  // reducer goes here
}

API

The following events are emitted:
  • redux-action-emitter:action

---