Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Propagate the use of useErrorReporter custom hook around the app #719

Open
itofarina opened this issue Feb 12, 2021 · 0 comments
Open

Propagate the use of useErrorReporter custom hook around the app #719

itofarina opened this issue Feb 12, 2021 · 0 comments
Labels

Comments

@itofarina
Copy link
Contributor

itofarina commented Feb 12, 2021

Problem

const errorReporter = useErrorReporter()

  errorReporter(new UIError({
    error: new Error(),
    id: 'some-id',
    text: 'some text',
  }))
  • In many places we are using the old way:
const {
    dispatch: appDispatch,
  } = useContext<AppContextProps>(AppContext)
  const reportError = useCallback((
    e: UIError,
  ) => errorReporterFactory(appDispatch)(e), [appDispatch])

reportError(new UIError({
    error: new Error(),
    id: 'some-id',
    text: 'some text',
  }))

Solution

Spread the use of the new custom hook replacing the old way

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant