How to use the @commercetools-frontend/actions-global.useShowApiErrorNotification function in @commercetools-frontend/actions-global

To help you get started, weā€™ve selected a few @commercetools-frontend/actions-global examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github commercetools / merchant-center-application-kit / playground / src / components / state-machines-details / state-machines-details.js View on Github external
const StateMachinesDetails = props => {
  const dataLocale = useApplicationContext(context => context.dataLocale);
  const dispatch = useDispatch();
  const fetcher = React.useCallback(
    (...args) => dispatch(fetchStateMachine(...args)),
    [dispatch]
  );
  const showApiErrorNotification = useShowApiErrorNotification();

  return (
    
      {({ isLoading, data, error }) => {
        if (isLoading) {
          return ;
        }
        if (error) {
          return null;
        }
        return (