🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

ba-react-fetch-list-api

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ba-react-fetch-list-api

Core module, combining all other modules into single infrastructure

latest
Source
npmnpm
Version
0.2.9
Version published
Maintainers
1
Created
Source

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`,
  }),
)

FAQs

Package last updated on 11 May 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts