2016-09-08 01:00:52 +02:00
|
|
|
import * as ActionTypes from '../../../constants';
|
|
|
|
|
|
|
|
export function hideToast() {
|
|
|
|
return {
|
|
|
|
type: ActionTypes.HIDE_TOAST
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-10-28 01:45:09 +02:00
|
|
|
export function showToast(time) {
|
2016-09-08 01:00:52 +02:00
|
|
|
return (dispatch) => {
|
|
|
|
dispatch({
|
|
|
|
type: ActionTypes.SHOW_TOAST
|
|
|
|
});
|
2016-10-28 01:45:09 +02:00
|
|
|
setTimeout(() => dispatch(hideToast()), time);
|
2016-09-08 01:00:52 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function setToastText(text) {
|
|
|
|
return {
|
|
|
|
type: ActionTypes.SET_TOAST_TEXT,
|
|
|
|
text
|
|
|
|
};
|
|
|
|
}
|