Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- async myFunction(context) {
- try {
- const data = {
- some: 'data'
- };
- await axios.post(data);
- await new Promise(resolve => {
- setTimeout(() => {
- context.commit('anotherFunction');
- setTimeout(() => {
- resetSomeState();
- resolve();
- }, 1000);
- }, 1000);
- });
- } catch(e) {
- logError(e);
- reject(e);
- }
- },
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement