Skip to content

Commit be23d8d

Browse files
committed
docs(LiveQuery): emit enter/leave event with updatedKeys
1 parent 3506c8a commit be23d8d

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/live-query.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,26 +35,28 @@ module.exports = (AV) => {
3535
* @param {AV.Object|AV.File} target updated object
3636
* @param {String[]} updatedKeys updated keys
3737
*/
38-
this.emit(op, target, updatedKeys);
39-
} else {
4038
/**
41-
* A new AV.Object which fulfills the Query you subscribe is created.
42-
* @event AV.LiveQuery#create
39+
* An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
40+
* @event AV.LiveQuery#enter
4341
* @param {AV.Object|AV.File} target updated object
42+
* @param {String[]} updatedKeys updated keys
4443
*/
4544
/**
46-
* An existing AV.Object which fulfills the Query you subscribe is deleted.
47-
* @event AV.LiveQuery#delete
45+
* An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
46+
* @event AV.LiveQuery#leave
4847
* @param {AV.Object|AV.File} target updated object
48+
* @param {String[]} updatedKeys updated keys
4949
*/
50+
this.emit(op, target, updatedKeys);
51+
} else {
5052
/**
51-
* An existing AV.Object which doesn't fulfill the Query is updated and now it fulfills the Query.
52-
* @event AV.LiveQuery#enter
53+
* A new AV.Object which fulfills the Query you subscribe is created.
54+
* @event AV.LiveQuery#create
5355
* @param {AV.Object|AV.File} target updated object
5456
*/
5557
/**
56-
* An existing AV.Object which fulfills the Query is updated and now it doesn't fulfill the Query.
57-
* @event AV.LiveQuery#leave
58+
* An existing AV.Object which fulfills the Query you subscribe is deleted.
59+
* @event AV.LiveQuery#delete
5860
* @param {AV.Object|AV.File} target updated object
5961
*/
6062
this.emit(op, target);

0 commit comments

Comments
 (0)