p5.js-web-editor/client/modules/IDE/actions/toast.js
Yining Shi 83b077450a Showing "Autosave enabled" toast ()
* showing Autosave enabled toast

* fixed variable names

* fixed constant name typo
2016-10-27 19:45:09 -04:00

23 lines
412 B
JavaScript

import * as ActionTypes from '../../../constants';
export function hideToast() {
return {
type: ActionTypes.HIDE_TOAST
};
}
export function showToast(time) {
return (dispatch) => {
dispatch({
type: ActionTypes.SHOW_TOAST
});
setTimeout(() => dispatch(hideToast()), time);
};
}
export function setToastText(text) {
return {
type: ActionTypes.SET_TOAST_TEXT,
text
};
}