How to use react-redux-toastr - 10 common examples

To help you get started, we’ve selected a few react-redux-toastr 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 resource-watch / resource-watch / components / widgets / editor / modal / SaveWidgetModal.js View on Github external
.catch((err) => {
        this.setState({
          saved: false,
          error: true,
          errorMessage: err.message
        });
        toastr.error('Error', err); // eslint-disable-line no-console
      })
      .then(() => this.setState({ loading: false }));
github el-davo / platmatic / app / cloud / apps / app-start.saga.ts View on Github external
function* start({guid}) {
	try {
		let settings: SettingsState = yield select((state: any) => state.settings);

		yield call(startApp, settings.activeInstance, guid);

		toastr.success('Alert', 'App started successfully');
	} catch (e) {
		console.log(e);

		toastr.success('Error', 'Unable to start app');
	}
}
github el-davo / platmatic / app / cloud / apps / app-stop.saga.ts View on Github external
function* stop({guid}) {
	try {
		let settings: SettingsState = yield select((state: any) => state.settings);

		yield call(stopApp, settings.activeInstance, guid);

		toastr.success('Alert', 'App stopped successfully');
	} catch (e) {
		console.log(e);

		toastr.success('Error', 'Unable to stop app');
	}
}
github el-davo / platmatic / app / cloud / apps / app-start.saga.ts View on Github external
function* start({guid}) {
	try {
		let settings: SettingsState = yield select((state: any) => state.settings);

		yield call(startApp, settings.activeInstance, guid);

		toastr.success('Alert', 'App started successfully');
	} catch (e) {
		console.log(e);

		toastr.success('Error', 'Unable to start app');
	}
}
github keyteki / keyteki / client / GameList.jsx View on Github external
watchGame(event, game) {
        event.preventDefault();

        if(!this.props.username) {
            toastr.error('Please login before trying to watch a game');
            return;
        }

        if(game.needsPassword) {
            this.props.joinPasswordGame(game, 'Watch');
        } else {
            this.props.socket.emit('watchgame', game.id);
        }
    }
github keyteki / keyteki / client / Components / Games / GameList.jsx View on Github external
watchGame(event, game) {
        let t = this.props.t;

        event.preventDefault();

        if(!this.props.user) {
            toastr.error(t('Please login before trying to watch a game'));
            return;
        }

        if(game.needsPassword) {
            this.props.joinPasswordGame(game, 'Watch');
        } else {
            this.props.socket.emit('watchgame', game.id);
        }
    }
github dlinknctu / OpenADM / ui / src / js / middlewares / socket.js View on Github external
export const socketIoMiddleware = store => next => action => {
  const result = next(action);

  if (action.type === 'CONNECT_SOCKET') {
    createSocket(store, (action.payload ?
      action.payload.coreURL : store.getState().setting.coreURL
    ));
  }
  if (!socket) {
    toastr.warning('websocket', "socket doesn't inital");
    return result;
  }

  if (SendActions.indexOf(action.type) > -1) {
    if (!socket.connected && action.type !== 'SETTING_CONTROLLER') {
      toastr.warning('websocket', 'Not connected');
      return result;
    }
    socket.emit(action.type, {
      data: action.payload,
    });
  }

  return result;
};
github resource-watch / resource-watch / components / admin / insights / table / InsightsTable.js View on Github external
onError: (error) => {
          this.setState({ message: `Error loading insights: ${error}`, loading: false });
          toastr.error('Error', error);
        }
      }
github resource-watch / resource-watch / components / admin / widget / form / WidgetForm.js View on Github external
onError: (error) => {
          this.setState({ loading: false });
          toastr.error('Error', error);
        }
      });
github resource-watch / resource-watch / components / datasets / metadata / form / component.js View on Github external
.catch((err) => {
          this.setState({ loading: false });
          toastr.error('Error', err);
        });
    }

react-redux-toastr

react-redux-toastr is a React toastr message implemented with Redux

MIT
Latest version published 2 months ago

Package Health Score

75 / 100
Full package analysis