I have a meteor method that will insert a question. When I run the method, I can see that it gets inserted into my list of questions in the browser and then it immediately disappears. Normally, this would suggest to me that the server is rejecting the code that is running on the client. However, when I do a hard refresh, the item shows back up. This seems really strange to me, either it should only run in the browser, in the case of if I forgot to add the method to the server api/ or it should not be not responsive in the browser until a hard refresh but not both. I think the issue may be that I am getting my questions list from my parameters in the URL so they don’t change when I make the update. How can I make react komposer reactive in a case like this where I am pulling questions based on the URL parameters and I insert a new document? Thanks!
const composer = (params, onData) => {
let subscription = Meteor.subscribe('questionsAnswersAdmin', params.courseSlug, params.lectureSlug);
if (subscription.ready()) {
const questions = Questions.find({}, {sort: {level:1}});
const answers = Answers.find();
onData(null, { questions, answers });
}
};
export default composeWithTracker(composer, Loading)(LectureAdminLayout);