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

“Expression has changed after it was checked” #84 #111

Merged
merged 1 commit into from
Nov 10, 2016

Conversation

nithril
Copy link

@nithril nithril commented Nov 6, 2016

please leave my your comments

this.lastText = momentConstructor(value).from(momentConstructor(), omitSuffix);

} else {
this.createTimer();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of calling createTimer() here? If we had a previous value, we have already created the timer, no?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its purpose is to recreate the timer once its callback has ran.

When the callback is running, lastText is computed and markForCheck is called. The timer must be recreated. Instead of resubmitting the timer inside the callback timer which could lead to more than one markForCheck for a given transform, I recreate the timer in the transform method because a markForCheck will lead to a transform calls.

Hope I'm understandable.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks!

@urish
Copy link
Owner

urish commented Nov 8, 2016

Looks good! I left one comment with a question that I had. Thanks!

@urish urish merged commit df22402 into urish:master Nov 10, 2016
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

Successfully merging this pull request may close these issues.

2 participants