Skip to content

Commit ef31cb5

Browse files
Remove execute function
Fixes #15
1 parent 3fc6695 commit ef31cb5

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

README.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Vue.use(AsyncMethods [,options])
2222

2323
### Options
2424

25-
#### createComputed
25+
#### createComputed
2626

2727
default `false`, if true: creates computeds that proxies `fetchArticles.resolvedWith` to `articles`
2828

@@ -63,7 +63,6 @@ And use the following helper variables in your view:
6363
```js
6464
articles // this is a computed that aliases fetchArticles.resolvedWith
6565
fetchArticles //call this function to fetch the articles
66-
fetchArticles.execute // executes the method, legacy support
6766
fetchArticles.promise // the current or last promise
6867
fetchArticles.isCalled // false until first called
6968
fetchArticles.isPending
@@ -88,7 +87,7 @@ It also registers a component called `catch-async-error` that enables you to cat
8887
{{article.name}}
8988
</li>
9089
</ul>
91-
90+
9291
<div v-if="fetchArticles.resolvedWithEmpty">
9392
There are no articles.
9493
</div>

index.js

-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ module.exports = {
171171
Vue.util.defineReactive(this, key, func)
172172

173173
var extra = {
174-
execute: func,
175174
promise: null,
176175
isCalled: false,
177176
isPending: false,

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"node": ">=4"
1414
},
1515
"scripts": {
16-
"test": "eslint . && mocha test"
16+
"test": "eslint . && mocha test",
17+
"develop": "mocha test --watch"
1718
},
1819
"files": [
1920
"index.js"

test.js

+2-6
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ describe('vue-async-methods custom options', function() {
6565
describe('when it succeds', function() {
6666
var article = {}
6767
beforeEach(function() {
68-
var call = vm.fetchArticle.execute()
68+
var call = vm.fetchArticle()
6969
resolvePromise(article)
7070
return call
7171
})
@@ -78,7 +78,7 @@ describe('vue-async-methods custom options', function() {
7878
describe('when it fail', function() {
7979
var error = new Error('fail')
8080
beforeEach(function() {
81-
var call = vm.fetchArticle.execute(1, 2, 3)
81+
var call = vm.fetchArticle(1, 2, 3)
8282
rejectPromise(error)
8383
return call.catch(function () {})
8484
})
@@ -103,10 +103,6 @@ describe('vue-async-methods default options', function() {
103103
})
104104
})
105105

106-
it('creates the method object on the vm', function() {
107-
expect(vm.fetch.execute).to.be.a('function')
108-
})
109-
110106
it('exposes the initial state', function() {
111107
expect(vm.fetch.promise).to.equal(null)
112108
expect(vm.fetch.isCalled).to.equal(false)

0 commit comments

Comments
 (0)