react-refetch icon indicating copy to clipboard operation
react-refetch copied to clipboard

Add refreshInterval option to identity requests

Open ipanasenko opened this issue 8 years ago • 0 comments

Hi.

As I understand, there is no way to do this right now. Is it possible to add this feature? I think it would give more flexibility, especially paired with https://github.com/heroku/react-refetch/issues/177

const fetchUser = id => fetch(`/users/${id}`);

connect(props => ({
  user: {
    value: () => fetchUser(props.match.params.id),
    refreshInterval: 60000
  }
}))(Profile);

In this example, function provided to value should be called every minute.

ipanasenko avatar Jul 17 '17 11:07 ipanasenko