Skip to content

Commit 7315c94

Browse files
committed
Build vuefire
1 parent a23b4ce commit 7315c94

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

Diff for: dist/vuefire.js

+18-2
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,22 @@ return /******/ (function(modules) { // webpackBootstrap
156156
}
157157
}
158158

159+
/**
160+
* Define a reactive property in a given vm if it's not defined
161+
* yet
162+
*
163+
* @param {Vue} vm
164+
* @param {string} key
165+
* @param {*} val
166+
*/
167+
function defineReactive (vm, key, val) {
168+
if (vm[key] === undefined) {
169+
Vue.util.defineReactive(vm, key, val)
170+
} else {
171+
vm[key] = val
172+
}
173+
}
174+
159175
/**
160176
* Bind a firebase data source to a key on a vm as an Array.
161177
*
@@ -166,7 +182,7 @@ return /******/ (function(modules) { // webpackBootstrap
166182
*/
167183
function bindAsArray (vm, key, source, cancelCallback) {
168184
var array = []
169-
Vue.util.defineReactive(vm, key, array)
185+
defineReactive(vm, key, array)
170186

171187
var onAdd = source.on('child_added', function (snapshot, prevKey) {
172188
var index = prevKey ? indexForKey(array, prevKey) + 1 : 0
@@ -207,7 +223,7 @@ return /******/ (function(modules) { // webpackBootstrap
207223
* @param {function|null} cancelCallback
208224
*/
209225
function bindAsObject (vm, key, source, cancelCallback) {
210-
Vue.util.defineReactive(vm, key, {})
226+
defineReactive(vm, key, {})
211227
var cb = source.on('value', function (snapshot) {
212228
vm[key] = createRecord(snapshot)
213229
}, cancelCallback)

Diff for: dist/vuefire.min.js

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

0 commit comments

Comments
 (0)