0.2.9 • Published 7 years ago

ba-react-fetch-list-api v0.2.9

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

Fetch list data from BluAvenu API

Usage example

Add reducer:

  const
    store = createStore(combineReducers({
      fetchApi: fetchListApiReducers([
        {baseURL: settings.API_URL, entity: 'contacts', key: 'contacts'}
      ]),
    ));

Now apply HOC. In your component you will get [flatFetched.contacts] with fetched data and some meta properties:

import FetchListAPI from 'ba-react-fetch-list-api';

compose(
  FetchListAPI({
    baseURL: settings.API_URL,
    entity : 'contacts',

    // These are GET-request params
    fetchParams: props => {search: props.searchValue},

    filters: 'filter.savedFilters',
    key    : 'contacts',
    page   : `incrementalList.${UNIQUE_ID}.page`,
    sorting: `table.${UNIQUE_ID}.sorting`,
  }),
)
0.3.0

7 years ago

0.2.9

7 years ago

0.2.7

7 years ago

0.2.6

7 years ago

0.2.5

7 years ago

0.2.4

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago