File tree 4 files changed +6
-11
lines changed
4 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Vue.use(AsyncMethods [,options])
22
22
23
23
### Options
24
24
25
- #### createComputed
25
+ #### createComputed
26
26
27
27
default ` false ` , if true: creates computeds that proxies ` fetchArticles.resolvedWith ` to ` articles `
28
28
@@ -63,7 +63,6 @@ And use the following helper variables in your view:
63
63
``` js
64
64
articles // this is a computed that aliases fetchArticles.resolvedWith
65
65
fetchArticles // call this function to fetch the articles
66
- fetchArticles .execute // executes the method, legacy support
67
66
fetchArticles .promise // the current or last promise
68
67
fetchArticles .isCalled // false until first called
69
68
fetchArticles .isPending
@@ -88,7 +87,7 @@ It also registers a component called `catch-async-error` that enables you to cat
88
87
{{article.name}}
89
88
</li >
90
89
</ul >
91
-
90
+
92
91
<div v-if =" fetchArticles.resolvedWithEmpty" >
93
92
There are no articles.
94
93
</div >
Original file line number Diff line number Diff line change @@ -171,7 +171,6 @@ module.exports = {
171
171
Vue . util . defineReactive ( this , key , func )
172
172
173
173
var extra = {
174
- execute : func ,
175
174
promise : null ,
176
175
isCalled : false ,
177
176
isPending : false ,
Original file line number Diff line number Diff line change 13
13
"node" : " >=4"
14
14
},
15
15
"scripts" : {
16
- "test" : " eslint . && mocha test"
16
+ "test" : " eslint . && mocha test" ,
17
+ "develop" : " mocha test --watch"
17
18
},
18
19
"files" : [
19
20
" index.js"
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ describe('vue-async-methods custom options', function() {
65
65
describe ( 'when it succeds' , function ( ) {
66
66
var article = { }
67
67
beforeEach ( function ( ) {
68
- var call = vm . fetchArticle . execute ( )
68
+ var call = vm . fetchArticle ( )
69
69
resolvePromise ( article )
70
70
return call
71
71
} )
@@ -78,7 +78,7 @@ describe('vue-async-methods custom options', function() {
78
78
describe ( 'when it fail' , function ( ) {
79
79
var error = new Error ( 'fail' )
80
80
beforeEach ( function ( ) {
81
- var call = vm . fetchArticle . execute ( 1 , 2 , 3 )
81
+ var call = vm . fetchArticle ( 1 , 2 , 3 )
82
82
rejectPromise ( error )
83
83
return call . catch ( function ( ) { } )
84
84
} )
@@ -103,10 +103,6 @@ describe('vue-async-methods default options', function() {
103
103
} )
104
104
} )
105
105
106
- it ( 'creates the method object on the vm' , function ( ) {
107
- expect ( vm . fetch . execute ) . to . be . a ( 'function' )
108
- } )
109
-
110
106
it ( 'exposes the initial state' , function ( ) {
111
107
expect ( vm . fetch . promise ) . to . equal ( null )
112
108
expect ( vm . fetch . isCalled ) . to . equal ( false )
You can’t perform that action at this time.
0 commit comments