-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db5b174
commit 0cee6b7
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ToastController } from '@ionic/angular'; | ||
|
||
const toast = new ToastController(); | ||
|
||
const onToast = async (message: string, color: string = 'success') => { | ||
const instance = await toast.create({ | ||
message, | ||
color, | ||
duration: 2000 | ||
}); | ||
return instance.present(); | ||
}; | ||
|
||
export const onError = async (message: string) => { | ||
return onToast(message, 'danger'); | ||
}; | ||
|
||
export const onSuccess = async (message: string) => { | ||
return onToast(message); | ||
}; |