Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save imcodetolive/2b7ef6b10ac7209b4eea12d4e5d9811d to your computer and use it in GitHub Desktop.
Save imcodetolive/2b7ef6b10ac7209b4eea12d4e5d9811d to your computer and use it in GitHub Desktop.

Revisions

  1. @arvidkahl arvidkahl created this gist Feb 12, 2017.
    11 changes: 11 additions & 0 deletions eventbus-advanced-prototype.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    // 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;
    }
    }
    }