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

add function to expose tracker inFlush variable #8565

merged 1 commit into from Apr 5, 2017


Copy link

@maxnowack maxnowack commented Apr 5, 2017

inFlush indicates wether a flush is active or not. Slightly the same like with one big difference. gets unset inside Tracker.nonreactive.
I want to savely call Tracker.flush() without getting the Can't call Tracker.flush while flushing error. doesn't work for me, since I don't know if the flush was called inside Tracker.nonreactive. I think I need to access the inFlush variable to get the global flushing state.

I'm writing a package to connect reactive data to react components. In direct comparison with react-meteor-data, I want to reduce the reruns of the reactive function if the props of the component change. To avoid unnecessary renders, I'm calling Tracker.flush() inside of componentWillReceiveProps to run the reactive function and set the new state.

benjamn approved these changes Apr 5, 2017
@benjamn benjamn merged commit 759671d into meteor:devel Apr 5, 2017
3 checks passed
Copy link

@benjamn benjamn commented Apr 5, 2017

Thanks @maxnowack, and good luck with your reactive React package.

@maxnowack maxnowack deleted the expose-tracker-inflush branch Apr 5, 2017
Copy link

@abernix abernix commented Apr 27, 2017

This should be available to test in the release candidate for Meteor, currently

meteor update --release

Please report any problems you encounter!

Copy link

@avalanche1 avalanche1 commented May 22, 2017

No mention in about it...

Copy link
Contributor Author

@maxnowack maxnowack commented May 23, 2017

@avalanche1 you're right. I've created a PR: meteor/docs#135

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

Successfully merging this pull request may close these issues.

None yet

4 participants