Skip to content

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