8000 Allow Vue.nextTick to be passed a context by ayamflow · Pull Request #385 · vuejs/vue · GitHub
[go: up one dir, main page]

Skip to content

Allow Vue.nextTick to be passed a context #385

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

Merged
merged 1 commit into from
Aug 5, 2014
Merged

Conversation

ayamflow
Copy link
@ayamflow ayamflow commented Aug 4, 2014

I always end up doing
Vue.nextTick(this.someFunction.bind(this)) which use the slow, native bind() function.

This PR enables to to:
Vue.nextTick(this.someFunction, this) which uses the fast bind function (and saves a few keystrokes if you're into that).

nextTick: function (cb) {
defer(cb, 0)
nextTick: function (cb, context) {
if(context) defer(utils.bind(cb), 0)
Copy link

Choose a reason for hiding this comment

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

probably utils.bind(cb, context)

@rayfranco
Copy link

+1 for this one

@ayamflow
Copy link
Author
ayamflow commented Aug 5, 2014

Sorry about the style, fixed !

yyx990803 added a commit that referenced this pull request Aug 5, 2014
Allow Vue.nextTick to be passed a context
@yyx990803 yyx990803 merged commit 754bf63 into vuejs:dev Aug 5, 2014
@yyx990803
Copy link
Member

Landed, thanks @ayamflow ! :D

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.

4 participants
0