Skip to content

Commit

Permalink
Fixes error thrown if data's initial value is null (#8)
Browse files Browse the repository at this point in the history
Or undefined. To reproduce/test this fix, simply try creating a component with a data property like so: `{ data: function() { return { something: null }; } }`
  • Loading branch information
OlenDavis authored and yyx990803 committed Sep 29, 2016
1 parent 10247d5 commit 305e7c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vue-rx.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
var raw = dataFn()
Object.keys(raw).forEach(function (key) {
var val = raw[key]
if (val.subscribe instanceof Function) {
if (val && val.subscribe instanceof Function) {
raw[key] = null
;(self._rxHandles || (self._rxHandles = []))
.push(val.subscribe(function (value) {
Expand Down

0 comments on commit 305e7c3

Please sign in to comment.