react-packages icon indicating copy to clipboard operation
react-packages copied to clipboard

react-meteor-data: handle.ready() is always false

Open derwaldgeist opened this issue 3 years ago • 3 comments

According to the docs, this should work:

const listLoading = useTracker(() => {
    // Note that this subscription will get cleaned up
    // when your component is unmounted or deps change.
    const handle = Meteor.subscribe('todoList', listId);
    return !handle.ready();
  }, [listId]);

However, if I try it out, the returned value is always true, i.e. ready() is always false.

derwaldgeist avatar Jul 20 '22 13:07 derwaldgeist

Note: I am using publishComposite in the background.

derwaldgeist avatar Jul 20 '22 13:07 derwaldgeist

  1. Does it work outside of useTracker? Like, in a standard Tracker.autorun?
  2. Does it work without the deps array (i.e., without the second useTracker argument)?

radekmie avatar Jul 21 '22 11:07 radekmie

2. Does it work without the deps array (i.e., without the second useTracker argument)?

This did not change anything. I have yet to try out 1.

derwaldgeist avatar Aug 03 '22 10:08 derwaldgeist