Skip to content

Instantly share code, notes, and snippets.

@arvidkahl
Created February 12, 2017 08:14
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save arvidkahl/56864cc30df43842e3a31e5beb57c559 to your computer and use it in GitHub Desktop.
Save arvidkahl/56864cc30df43842e3a31e5beb57c559 to your computer and use it in GitHub Desktop.
eventbus-advanced-prototype.js
// Create a global Event Bus
var EventBus = new Vue()
// Add to Vue properties by exposing a getter for $bus
Object.defineProperties(Vue.prototype, {
$bus: {
get: function () {
return EventBus;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment