Skip to content

Commit dc8a416

Browse files
committed
Release 1.4.0
1 parent 102e0b1 commit dc8a416

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

dist/vuefire.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,12 @@ return /******/ (function(modules) { // webpackBootstrap
136136
function bind (vm, key, source) {
137137
var asObject = false
138138
var cancelCallback = null
139+
var readyCallback = null
139140
// check { source, asArray, cancelCallback } syntax
140141
if (isObject(source) && source.hasOwnProperty('source')) {
141142
asObject = source.asObject
142143
cancelCallback = source.cancelCallback
144+
readyCallback = source.readyCallback
143145
source = source.source
144146
}
145147
if (!isObject(source)) {
@@ -154,6 +156,9 @@ return /******/ (function(modules) { // webpackBootstrap
154156
} else {
155157
bindAsArray(vm, key, source, cancelCallback)
156158
}
159+
if (readyCallback) {
160+
source.once('value', readyCallback.bind(vm))
161+
}
157162
}
158163

159164
/**
@@ -306,20 +311,22 @@ return /******/ (function(modules) { // webpackBootstrap
306311
mergeStrats.firebase = mergeStrats.methods
307312

308313
// extend instance methods
309-
Vue.prototype.$bindAsObject = function (key, source, cancelCallback) {
314+
Vue.prototype.$bindAsObject = function (key, source, cancelCallback, readyCallback) {
310315
ensureRefs(this)
311316
bind(this, key, {
312317
source: source,
313318
asObject: true,
314-
cancelCallback: cancelCallback
319+
cancelCallback: cancelCallback,
320+
readyCallback: readyCallback
315321
})
316322
}
317323

318-
Vue.prototype.$bindAsArray = function (key, source, cancelCallback) {
324+
Vue.prototype.$bindAsArray = function (key, source, cancelCallback, readyCallback) {
319325
ensureRefs(this)
320326
bind(this, key, {
321327
source: source,
322-
cancelCallback: cancelCallback
328+
cancelCallback: cancelCallback,
329+
readyCallback: readyCallback
323330
})
324331
}
325332

dist/vuefire.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vuefire",
3-
"version": "1.3.1",
3+
"version": "1.4.0",
44
"description": "Firebase bindings for Vue.js",
55
"main": "dist/vuefire.js",
66
"files": [

0 commit comments

Comments
 (0)