@cisdi/data-provider

data provider for react component

Usage no npm install needed!

<script type="module">
  import cisdiDataProvider from 'https://cdn.skypack.dev/@cisdi/data-provider';
</script>

README

DataProvider

DataProvider for UI Engine Components

Install

npm install @cisdi/data-provider

Usage

import DataProvider from '@cisdi/data-provider'

const Demo = () => (
  <DataProvider dataSource="https://example.com/" interval={1000}>
    <Test />
  </DataProvider>
)

Props

  • dataSource: it can be original data or URL
  • interval: time interval
  • sourceName: source key from dataSource, support chain, ex: data.items
  • propsName: props key of child props, support chain, ex: chart.data
  • params: http request params, treated as search in GET and body in POST
  • headers: http request headers
  • normalize: normalize http request data, default is (data: any) => data

Develop

npm install
npm run build