Components

UpdateOnInterval

UpdateOnInterval

This render props component willupdate it's children via props while executing data loaders sent as props to the component.

Note: Dataloaders are made to be at an app level to keep the component generic, the return of Dataloaders are sent as props to its children.

Example

import {UpdateOnInterval} from '@quintype/components';

const story = {
   'example' : 'data'
};

function getData() {
    return fetch('/url/something')//...
}

<UpdateOnInterval dataLoader={getData} interval={3000} initData={story}>
 {
   ({data}) => <Component data={data}></Component>
 }
</UpdateOnInterval>