You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
When we receive a ready message for a subscription we call the readyCallback before actually marking the subscription as ready. Is there a reason for this? I want to achieve the following but cannot:
Lets say we have a subscription called someSub that publishes some interesting data. This interesting data is used by getSomeData(). I want to make sure that developers on my team dont call getSomeData until the someSub subscription is ready, since it could lead to unpredictable and particularly buggy state.
Now, in the example below, I call getSomeData within the onReady callback function, and it still throws an error.
MySubs.something=Meteor.subscribe('someSub',function(){// do some stuff...vardata=getSomeData();// do some more stuff...});
inside getSomeData
functiongetSomeData(){if(!MySubs.something.ready()){// THIS THROWS when i call getSomeData from the ready callback.thrownewError()}// do some important stuff with the data published by someSub}
This may just be an edge case, but to me. it seems that ready() should return true from inside the readyCallback. What do you think?
The text was updated successfully, but these errors were encountered:
Hi Meteor Team!
I had a question about these lines of code: https://github.com/meteor/meteor/blob/master/packages/ddp/livedata_connection.js#L1377-L1379
When we receive a ready message for a subscription we call the
readyCallback
before actually marking the subscription as ready. Is there a reason for this? I want to achieve the following but cannot:Lets say we have a subscription called
someSub
that publishes some interesting data. This interesting data is used bygetSomeData()
. I want to make sure that developers on my team dont call getSomeData until thesomeSub
subscription is ready, since it could lead to unpredictable and particularly buggy state.Now, in the example below, I call getSomeData within the onReady callback function, and it still throws an error.
inside
getSomeData
This may just be an edge case, but to me. it seems that
ready()
should return true from inside thereadyCallback
. What do you think?The text was updated successfully, but these errors were encountered: