Skip to content

Commit 802c224

Browse files
committed
Release 1.2.1
1 parent 1617cd9 commit 802c224

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

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 (key in vm) {
169+
vm[key] = val
170+
} else {
171+
Vue.util.defineReactive(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)

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.2.0",
3+
"version": "1.2.1",
44
"description": "Firebase bindings for Vue.js",
55
"main": "dist/vuefire.js",
66
"files": [

0 commit comments

Comments
 (0)