Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Commit

Permalink
v1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffan committed Jan 26, 2018
1 parent 1643e73 commit a685ab7
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ $ npm install vue-event-manager
```

### CDN
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/[email protected].5) or [unpkg](https://unpkg.com/[email protected].5).
Available on [jsdelivr](https://cdn.jsdelivr.net/npm/[email protected].6) or [unpkg](https://unpkg.com/[email protected].6).
```html
<script src="https://cdn.jsdelivr.net/npm/[email protected].5"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected].6"></script>
```

## Example
Expand Down
17 changes: 15 additions & 2 deletions dist/vue-event-manager.common.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-event-manager v1.0.5
* vue-event-manager v1.0.6
* https://github.com/pagekit/vue-event-manager
* Released under the MIT License.
*/
Expand All @@ -26,6 +26,8 @@ function forEach(collection, callback) {
* Array.findIndex() polyfill.
*/
if (!Array.prototype.findIndex) {

// eslint-disable-next-line
Object.defineProperty(Array.prototype, 'findIndex', {

value: function value(predicate) {
Expand Down Expand Up @@ -177,14 +179,25 @@ function initEvents() {
listener = listener.handler;
}

_events.push(Events.on(event, listener.bind(this$1), priority));
_events.push(Events.on(event, bindListener(listener, this$1), priority));
});
});

this.$on('hook:beforeDestroy', function () { return _events.forEach(function (off) { return off(); }); });
}
}

function bindListener(fn, vm) {

if (typeof fn === 'string') {
return function () {
return vm[fn].apply(vm, arguments);
}
}

return fn.bind(vm);
}

if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(Events);
}
Expand Down
17 changes: 15 additions & 2 deletions dist/vue-event-manager.es2015.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-event-manager v1.0.5
* vue-event-manager v1.0.6
* https://github.com/pagekit/vue-event-manager
* Released under the MIT License.
*/
Expand All @@ -24,6 +24,8 @@ function forEach(collection, callback) {
* Array.findIndex() polyfill.
*/
if (!Array.prototype.findIndex) {

// eslint-disable-next-line
Object.defineProperty(Array.prototype, 'findIndex', {

value: function value(predicate) {
Expand Down Expand Up @@ -175,14 +177,25 @@ function initEvents() {
listener = listener.handler;
}

_events.push(Events.on(event, listener.bind(this$1), priority));
_events.push(Events.on(event, bindListener(listener, this$1), priority));
});
});

this.$on('hook:beforeDestroy', function () { return _events.forEach(function (off) { return off(); }); });
}
}

function bindListener(fn, vm) {

if (typeof fn === 'string') {
return function () {
return vm[fn].apply(vm, arguments);
}
}

return fn.bind(vm);
}

if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(Events);
}
Expand Down
17 changes: 15 additions & 2 deletions dist/vue-event-manager.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* vue-event-manager v1.0.5
* vue-event-manager v1.0.6
* https://github.com/pagekit/vue-event-manager
* Released under the MIT License.
*/
Expand Down Expand Up @@ -30,6 +30,8 @@ function forEach(collection, callback) {
* Array.findIndex() polyfill.
*/
if (!Array.prototype.findIndex) {

// eslint-disable-next-line
Object.defineProperty(Array.prototype, 'findIndex', {

value: function value(predicate) {
Expand Down Expand Up @@ -181,14 +183,25 @@ function initEvents() {
listener = listener.handler;
}

_events.push(Events.on(event, listener.bind(this$1), priority));
_events.push(Events.on(event, bindListener(listener, this$1), priority));
});
});

this.$on('hook:beforeDestroy', function () { return _events.forEach(function (off) { return off(); }); });
}
}

function bindListener(fn, vm) {

if (typeof fn === 'string') {
return function () {
return vm[fn].apply(vm, arguments);
}
}

return fn.bind(vm);
}

if (typeof window !== 'undefined' && window.Vue) {
window.Vue.use(Events);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/vue-event-manager.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-event-manager",
"version": "1.0.5",
"version": "1.0.6",
"main": "dist/vue-event-manager.common.js",
"module": "dist/vue-event-manager.es2015.js",
"unpkg": "dist/vue-event-manager.min.js",
Expand Down

0 comments on commit a685ab7

Please sign in to comment.