Skip to content

Enhancement #453 Reactive pollInterval. #613

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 3 commits into from
Sep 7, 2019
Merged

Conversation

joelmandell
Copy link
Contributor

@joelmandell joelmandell commented May 16, 2019

Reactive pollInterval.

Example:

 apollo: {
    allMessages: {
        query:gql`query { allMessages { done id information} }`,
        pollInterval() {
          return this.shouldPoll ? 300 : null
        },
    }
  }

reactive pollINterval

Copy link
Contributor Author

@joelmandell joelmandell left a comment

Choose a reason for hiding this comment

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

In previous commit you had to do:

pollInterval() {
    return { 
        pollInterval: this.screenRefreshMs 
    }
}

Now you can do this:

pollInterval() {
    return this.screenRefreshMs
}

@joelmandell
Copy link
Contributor Author

joelmandell commented May 17, 2019

In my first commit I did look for a object with property named pollInterval.
Because of that I had to do an if-check if oldValue was undefined during observation start.
In my second commit I returned only value of evaluated expression and not object.
But if-check if oldValue was undefined was left.

Because I am not looking for a property named pollInterval on oldValue anymore, there is no need for that check. That's why I removed the if-check in commit ea6af08

@joelmandell joelmandell changed the title Enhancement Akryum#453 Reactive pollInterval. Enhancement #453 Reactive pollInterval. May 27, 2019
@Akryum Akryum merged commit 51590c8 into vuejs:master Sep 7, 2019
@Akryum
Copy link
Member

Akryum commented Sep 7, 2019

👍

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