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