Skip to content

lexich/redux-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About redux-error

Build Status NPM version Coverage Status

###Usage

import { createStore, applyMiddleware, combineReducers } from "redux";
import thunk from "redux-thunk";
import reducers from "./reducers"; // Redux reducers
import reduxError from "redux-error";

const crushReporter = reduxError.getCatcher(function(err) {
  console.error(err);
  // you can rethrow this error to global context with
  throw err; 
  /*
  it will be uncatch error;
  in node js you can catch it
  
  process.on("uncaughtException", function(err) {
    ....
  });
  
  in browser 
  window.onerror = function(error, url, lineNumber) {
    ....
  }
  */
});

const reducer = combineReducers( reducers );
const finalCreateStore = applyMiddleware(crushReporter, thunk)(createStore);
const store = finalCreateStore(reducer);
// .... other actions according redux manual

About

Redux error processor

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published