vue-async-methods
Advanced tools
Comparing version 0.8.1 to 0.9.0
14
index.js
@@ -170,4 +170,8 @@ 'use strict' | ||
for (var key in asyncMethods) { | ||
Vue.util.defineReactive(this, key, { | ||
execute: wrapMethod(asyncMethods[key], this, key), | ||
var func = wrapMethod(asyncMethods[key], this, key) | ||
Vue.util.defineReactive(this, key, func) | ||
var extra = { | ||
execute: func, | ||
promise: null, | ||
@@ -183,3 +187,7 @@ isCalled: false, | ||
handleErrorInView: false | ||
}) | ||
} | ||
for (var prop in extra) { | ||
Vue.util.defineReactive(func, prop, extra[prop]) | ||
} | ||
@@ -186,0 +194,0 @@ // add computed |
{ | ||
"name": "vue-async-methods", | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"description": "Vue async methods support", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -65,3 +65,4 @@ # vue-async-methods [![Build Status](https://travis-ci.org/mokkabonna/vue-async-methods.svg?branch=master)](https://travis-ci.org/mokkabonna/vue-async-methods) | ||
articles // this is a computed that aliases fetchArticles.resolvedWith | ||
fetchArticles.execute // executes the method | ||
fetchArticles //call this function to fetch the articles | ||
fetchArticles.execute // executes the method, legacy support | ||
fetchArticles.promise // the current or last promise | ||
@@ -82,3 +83,3 @@ fetchArticles.isCalled // false until first called | ||
```html | ||
<button type="button" @click="fetchArticles.execute">Load data</button> | ||
<button type="button" @click="fetchArticles">Load data</button> | ||
<div v-if="!fetchArticles.isCalled">Click button to load data</div> | ||
@@ -85,0 +86,0 @@ <div v-if="fetchArticles.isPending">Loading data...</div> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10869
172
110