Skip to content

Commit 305e7c3

Browse files
OlenDavisyyx990803
authored andcommitted
Fixes error thrown if data's initial value is null (#8)
Or undefined. To reproduce/test this fix, simply try creating a component with a data property like so: `{ data: function() { return { something: null }; } }`
1 parent 10247d5 commit 305e7c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vue-rx.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
var raw = dataFn()
2222
Object.keys(raw).forEach(function (key) {
2323
var val = raw[key]
24-
if (val.subscribe instanceof Function) {
24+
if (val && val.subscribe instanceof Function) {
2525
raw[key] = null
2626
;(self._rxHandles || (self._rxHandles = []))
2727
.push(val.subscribe(function (value) {

0 commit comments

Comments
 (0)