Commit cec5989c authored by Konrad Mohrfeldt's avatar Konrad Mohrfeldt

paginator actions should return promises

paginators reset, refresh, next, and prev actions are all async and the
caller might want to know when these actions finished.
parent 50d91d9a
......@@ -145,22 +145,22 @@
this.items = []
this.count = this.nextUrl = this.prevUrl = null
this.page = typeof page === 'number' ? Math.max(1, page) : 1
this.updateFrom(this.currentQueryString, true)
return this.updateFrom(this.currentQueryString, true)
},
refresh () {
this.collection.clearCache()
this.reset()
return this.reset()
},
prev () {
if (this.hasPrev) {
this.page -= 1
this.updateFrom(this.currentQueryString)
return this.updateFrom(this.currentQueryString)
}
},
next () {
if (this.hasNext) {
this.page += 1
this.updateFrom(this.currentQueryString)
return this.updateFrom(this.currentQueryString)
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment