Add toasts to react app

This commit is contained in:
Berkeley Martinez
2016-01-07 14:51:41 -08:00
parent 6c73f52970
commit 8e930fbe8a
11 changed files with 373 additions and 17 deletions

View File

@@ -33,8 +33,24 @@ export default Actions({
},
// routing
// goTo(path: String) => path
goTo: null,
// goBack(arg?) => arg?
goBack: null,
// toast(args: { type?: String, message: String, title: String }) => args
toast(args) {
return {
transform(state) {
const id = state.toast && state.toast.id ? state.toast.id : 0;
const toast = { ...args, id: id + 1 };
return { ...state, toast };
}
};
},
// updateLocation(location: { pathname: String }) => location
updateLocation(location) {
return {
transform(state) {