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

Trigger digest when Subscription ready changes #1655

Open
wants to merge 5 commits into
base: angular1
Choose a base branch
from

Conversation

SimonSimCity
Copy link

Sorry, but I wasn't really able to wrap my head around how to test this feature ...

In my example, I wanted to call the ready() method of a subscription directly in the HTML template of my AngularJS app. This change now makes this possible by running the $digest cycle every time the ready-property of a subscription (and thereby also the response of the ready() method) changes.

My first attempt included a call of ready(), but this broke an existing test, where you rely on calling the ready() method. Therefore I changed it to use the meteor-internal property _subscriptions to directly access the ready-computation for this subscription.

The autorun I added is registered as a dependency of the outer autorun and will be stopped once the outer autorun is called again.

Looking forward to your response. I'll already start using this in my project.

… dependency of a trigger, that triggers a new digest if it's not already in one.
@SimonSimCity
Copy link
Author

@Urigo any update on this one? I'm using this for quite a while now and don't see any downsides. If there are, or things I overlooked, I'd like to know.

Also if it's simply because of the fact that you don't want to put any effort into Meteor for AngularJS but rather focus on it's successor.

@SimonSimCity
Copy link
Author

I've updated the code to use the public method, provided by Meteor instead some internal properties, that aren't part of the public interface of Meteor.

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

Successfully merging this pull request may close these issues.

None yet

2 participants