Created
April 2, 2019 14:13
-
-
Save bjensen/9348d82e0c1755dcad88e64206896c0d to your computer and use it in GitHub Desktop.
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
import authService from "../auth/authService"; | |
export default { | |
install(Vue) { | |
Vue.prototype.$auth = authService; | |
Vue.mixin({ | |
created() { | |
if (this.handleLoginEvent) { | |
authService.addListener('loginEvent', this.handleLoginEvent); | |
} | |
}, | |
destroyed() { | |
if (this.handleLoginEvent) { | |
authService.removeListener('loginEvent', this.handleLoginEvent); | |
} | |
} | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment