@flowlist/react-flowlist
TypeScript icon, indicating that this package has built-in type declarations

0.2.25 • Public • Published

@flowlist/react-flowlist

Install

yarn add @flowlist/react-flowlist

Usage

const someQuery = {
  count: 10
}
const getList = (params) => new Promise((resolve, reject) => {
  try {
    console.log('params contain someQuery', params)
    const list = await fetch('/get/data/route')

    resolve({
      total: 0,
      noMore: false,
      result: list
    })
  } catch (err) {
    reject(err)
  }
})
<FlowList
  func={getList}
  query={someQuery}
  mainSlot={(({ result }) => {
    return result.map((item) => {
      return <ListItem item={item} key={item.id}></ListItem>
    })
  })}
  firstloadingSlot={() => {
    return <>launch loading slot</>
  }}
  firstErrorSlot={() => {
    return <>launch error slot</>
  }}
  nothingSlot={() => {
    return <>list empty slot</>
  }}
  loadingSlot={() => {
    return <>load more loading slot</>
  }}
></FlowList>

Readme

Keywords

none

Package Sidebar

Install

npm i @flowlist/react-flowlist

Weekly Downloads

0

Version

0.2.25

License

none

Unpacked Size

71.4 kB

Total Files

8

Last publish

Collaborators

  • falstack