mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
- fix test livedata stub - methods calling methods
This commit is contained in:
@@ -1741,8 +1741,6 @@ export class Connection {
|
||||
}
|
||||
|
||||
async onMessage(raw_msg) {
|
||||
//TODO[fibers]: remove comment
|
||||
console.log('onMessage', raw_msg);
|
||||
let msg;
|
||||
try {
|
||||
msg = DDPCommon.parseDDP(raw_msg);
|
||||
|
||||
@@ -678,18 +678,19 @@ if (Meteor.isClient) {
|
||||
|
||||
// setup methods
|
||||
conn.methods({
|
||||
do_something: function() {
|
||||
conn.call('do_something_else');
|
||||
do_something: async function() {
|
||||
await conn.applyAsync('do_something_else', []);
|
||||
},
|
||||
do_something_else: function() {
|
||||
coll.insertAsync({ a: 1 });
|
||||
do_something_else: async function() {
|
||||
await coll.insertAsync({ a: 1 });
|
||||
}
|
||||
});
|
||||
|
||||
const o = await observeCursor(test, coll.find());
|
||||
|
||||
// call method.
|
||||
conn.call('do_something', _.identity);
|
||||
// we use the applyAsync() instead of callAsync() because we want to control when to "pause"
|
||||
// or "continue" the method execution by using the methods stream.receive()
|
||||
await conn.applyAsync('do_something', []);
|
||||
|
||||
// see we only send message for outer methods
|
||||
const message = testGotMessage(test, stream, {
|
||||
|
||||
Reference in New Issue
Block a user