Skip to content

Latest commit

 

History

History
28 lines (23 loc) · 604 Bytes

README.md

File metadata and controls

28 lines (23 loc) · 604 Bytes

dva-sentry

NPM version

tracing action and effect, upload when an error occurs

import createSentry from 'dva-sentry';

const { user: { login, name, workid, email }, env } = window.context;
const app = dva();

app.use(createSentry({
  onReducerError,
  onEffectError,
  dsn,
  config: {
    environment: env,
    shouldSendCallback: data => data.environment !== 'local'
      && data.environment !== 'unittest',
  },
  context: {
    user: {
      login, name, workid, email,
    },
  },
}));