Last active
August 20, 2018 15:00
-
-
Save enkot/2e8eb26c3d3fb617e4d5f6560e85860f 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
import Catch, { catchDecoratorStore } from './catchDecorator' | |
catchDecoratorStore.setHandler(error => Toast.error(error.message)) | |
@Component | |
export default class App extends Vue { | |
@Catch | |
async created() { | |
const data = await api.getData() // throws Error | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment