Skip to content

Commit 6c6ebd6

Browse files
committed
fix(bind): check for where function when binding
Should correctly detect if the ref is a collection or a document fix #146
1 parent 0e926f6 commit 6c6ebd6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ function bindDocument ({
6565

6666
function bind ({ vm, key, ref }) {
6767
let unbind
68-
if (ref.add) {
68+
if (ref.where) {
6969
unbind = bindCollection({
7070
vm,
7171
key,

test/helpers/mock.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ class CollectionReference {
8787
return this.data[id]
8888
}
8989

90+
// used to check if it's a collection or document ref
91+
where () {}
92+
9093
doc (id) {
9194
id = id || new Key()
9295
return this.data[id] = this.data[id] || new DocumentReference({

0 commit comments

Comments
 (0)