rematch: onError

Should handle global errors. The following should work.

init({
  onError: (e) => console.log(e)
})

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (9 by maintainers)

Most upvoted comments

Note: look into how error handling is done in this project: https://github.com/PlatziDev/redux-catch

Alternatively, we could expose configuration settings to plugins.

So when a plugin is created it can be called immediately with rematch config.

// plugin
const plugin1 = (config) => (rematchConfig) => {
  /* ... */
}
// on init
const plugin1 = createPlugin1(pluginSpecificConfig)

init({
  plugins: [plugin1],
  onError: console.log,
})
// inside of rematch
const rematchConfig = { onError }
plugin1(rematchConfig)