Last active
August 20, 2018 08:52
-
-
Save enkot/e9e70955711120207b7371859b73c861 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| // register global handler | |
| catchDecorator.register((error) => Toast.error(error.message)) | |
| @Component | |
| class LoginPage extends Vue { | |
| // ... | |
| // catch errors and run global handler | |
| @Catch() | |
| async loginUser() { | |
| const token = await api.loginUser(this.email, this.password) | |
| handleLogin(token) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment