🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

vue-async-methods

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-async-methods - npm Package Compare versions

Comparing version

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>