Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] useCursor #1

Open
mattblackdev opened this issue Apr 1, 2022 · 2 comments
Open

[Question] useCursor #1

mattblackdev opened this issue Apr 1, 2022 · 2 comments

Comments

@mattblackdev
Copy link

Hey awesome job on this! Where's useCursor coming from in the readme examples? Is it the same as doing this: useTracker(() => MyCollection.find())?

@rijk
Copy link
Owner

rijk commented Apr 1, 2022

Thanks @mattblackdev (I know it's lame to comment on this but — awesome name 😁)

useCursor was from an upcoming version of react-meteor-data, which I think @CaptainN ended up abandoning.

@rijk
Copy link
Owner

rijk commented Apr 1, 2022

Yeah, found the original PR: meteor/react-packages#298

I've broken out the remaining work from this PR to meteor/react-packages#332 (useFind and a new version of useSubscribe added to react-meteor-data) and meteor/react-packages#333 (new package: react-meteor-state with useMeteorState hook).

I'll do the same for react-meteor-accounts and that will obsolete this PR.

That said, I think you should be fine replacing the calls with useTracker or something similar — the key for this is replacing the subscription (useSubscribe or Meteor.subscribe), and then you get the benefit of Suspense meaning the data will be there below that. How you then get the data is probably irrelevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants